Last active
September 5, 2025 07:18
-
-
Save MkDierz/445d4a34e55537f1ad1494b8089d4df8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- Set up error handling and user feedback --- | |
| set -e | |
| echo "Starting software installation script... β³" | |
| echo "----------------------------------------" | |
| # --- Install essential dependencies --- | |
| echo "βοΈ Checking for wget and unzip..." | |
| sudo apt update -y | |
| sudo apt install wget unzip -y | |
| # --- Install GitHub CLI (gh) --- | |
| echo "π Installing GitHub CLI (gh)..." | |
| if command -v gh &> /dev/null; then | |
| echo "β GitHub CLI is already installed. Skipping..." | |
| else | |
| sudo mkdir -p -m 755 /etc/apt/keyrings | |
| temp_keyring=$(mktemp) | |
| wget -nv -O "$temp_keyring" https://cli.github.com/packages/githubcli-archive-keyring.gpg | |
| sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null < "$temp_keyring" | |
| sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg | |
| rm "$temp_keyring" | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
| sudo apt update -y | |
| sudo apt install gh -y | |
| echo "β GitHub CLI installed successfully." | |
| fi | |
| echo "----------------------------------------" | |
| # --- Install Nginx --- | |
| echo "π Installing Nginx..." | |
| sudo apt install nginx -y | |
| echo "β Nginx installed successfully." | |
| echo "----------------------------------------" | |
| # --- Install Node Version Manager (nvm) --- | |
| echo "π¦ Installing Node Version Manager (nvm)..." | |
| # The curl command to install nvm should be run as the user, not root. | |
| # Using 'bash' will execute the install script. | |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash | |
| # To make 'nvm' commands available in the current script, we need to source the nvm script. | |
| # This assumes a standard shell like bash. | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| # Now install and use the LTS version of Node.js | |
| echo "β‘οΈ Installing Node.js LTS version..." | |
| nvm install --lts | |
| # Setting the LTS version as the default | |
| nvm alias default 'lts/*' | |
| echo "β Node.js and npm are now installed. nvm is configured to use the LTS version." | |
| echo "----------------------------------------" | |
| # --- Install PM2 --- | |
| echo "π Installing PM2..." | |
| # This command must run after Node.js and npm are installed. | |
| npm install pm2 -g | |
| echo "β PM2 installed successfully." | |
| echo "----------------------------------------" | |
| # --- Install uv (Python package installer) --- | |
| echo "π Installing uv..." | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "β uv installed successfully." | |
| echo "----------------------------------------" | |
| # --- Install Bun --- | |
| echo "π Installing Bun..." | |
| curl -fsSL https://bun.sh/install | bash | |
| echo "β Bun installed successfully." | |
| echo "----------------------------------------" | |
| --- | |
| ### Load Environment Variables | |
| echo "π Sourcing environment variables from ~/.local/bin/env and ~/.bashrc..." | |
| source $HOME/.local/bin/env | |
| source $HOME/.bashrc | |
| echo "β Environment variables loaded." | |
| echo "π All requested software has been installed! Enjoy! π" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment