Skip to content

Instantly share code, notes, and snippets.

@brettjrea
Last active April 18, 2023 23:51
Show Gist options
  • Save brettjrea/f4a2ba1a4d2f73c35fc72ef0db679f63 to your computer and use it in GitHub Desktop.
Save brettjrea/f4a2ba1a4d2f73c35fc72ef0db679f63 to your computer and use it in GitHub Desktop.
#!/bin/bash
# update and upgrade packages
sudo apt update -y && sudo apt upgrade -y
# remove unused packages
sudo apt autoremove -y
sudo apt install git curl procps -y
export NVS_HOME="$HOME/.nvs"
git clone https://github.com/jasongin/nvs "$NVS_HOME"
. "$NVS_HOME/nvs.sh" install
echo 'export NVS_HOME="$HOME/.nvs"' >> ~/.bashrc
echo '[ -s "$NVS_HOME/nvs.sh" ] && . "$NVS_HOME/nvs.sh" # This loads NVS' >> ~/.bashrc
export NVS_HOME="$HOME/.nvs"
[ -s "$NVS_HOME/nvs.sh" ] && . "$NVS_HOME/nvs.sh"
# install latest version of Node.js might need to use `source nvs.sh`
nvs add lts
nvs use lts
# Add NVS and Node to the PATH environment variable
echo 'export NVS_HOME="$HOME/.nvs"' >> ~/.bashrc
echo '[ -s "$NVS_HOME/nvs.sh" ] && . "$NVS_HOME/nvs.sh" # This loads NVS' >> ~/.bashrc
echo 'export PATH="$NVS_HOME/$(nvs which latest)":$PATH' >> ~/.bashrc
# Reload the shell to apply the PATH changes
exec bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment