Skip to content

Instantly share code, notes, and snippets.

@taoxuau
Last active July 18, 2021 22:28
Show Gist options
  • Save taoxuau/5caf33b802455fbb8bcb332f7749a754 to your computer and use it in GitHub Desktop.
Save taoxuau/5caf33b802455fbb8bcb332f7749a754 to your computer and use it in GitHub Desktop.
Install all packges needed for a Ubuntu Server
# install
# curl -L https://gist.github.com/taoxuau/5caf33b802455fbb8bcb332f7749a754/raw/ubuntu-server-install.sh | bash
#
sudo apt update && sudo apt upgrade --yes
#################### nvm node npm ####################
# https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install 14.16.1
nvm use 14.16.1
npm install -g npm
nvm -v
node -v
npm -v
#################### pyenv python pip ####################
# https://github.com/pyenv/pyenv-installer
sudo apt install --yes --no-install-recommends \
make build-essential wget curl llvm xz-utils libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev libncurses5-dev tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
curl https://pyenv.run | bash
echo '
# pyenv
if [ -d "$HOME/.pyenv/bin" ] ; then
PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi' >> ~/.profile
source ~/.profile
echo '
# pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi' >> ~/.bashrc
source ~/.bashrc
pyenv update
pyenv install 3.7.10
pyenv local 3.7.10
pip install --upgrade pip
pyenv -v
python -V
pip -V
#################### rbenv ruby gem rails ####################
# https://github.com/rbenv/rbenv-installer
sudo apt install --yes --no-install-recommends \
autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
echo '
# rbenv
if [ -d "$HOME/.rbenv/bin" ] ; then
PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
fi' >> ~/.profile
source ~/.profile
rbenv install 3.0.1
rbenv local 3.0.1
gem install rails
rbenv -v
ruby -v
gem -v
rails -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment