Last active
August 26, 2024 06:22
-
-
Save AbrarNitk/c3cb8dcf1482b0cb49970efd14c07d1b to your computer and use it in GitHub Desktop.
Install zsh, oh-my-zsh, postgres, java, maven, rust, pyenv, pyenv-virtualenv on Ubuntu-linux
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
## update machine | |
sudo apt-get update | |
## Install essentials and basic utility | |
sudo apt install -y \ | |
build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | |
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | |
## Install zsh | |
sudo apt-get -y install zsh | |
## check zsh version | |
zsh --version | |
# Now set ZSH as the default login shell for the user you’re logged in as with the following command: | |
sudo usermod -s /usr/bin/zsh $(whoami) | |
sudo chsh -s $(which zsh) $(whoami) | |
## after this step open new terminal and run remaining commands | |
## Installing Powerline and Powerline Fonts for ZSH: | |
#sudo apt-get install powerline fonts-powerline | |
## Installing ZSH Powerlevel9k Theme: | |
#sudo apt-get install zsh-theme-powerlevel9k | |
## Install oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
## Install pyenv for maintiaing defferent python versions and virtual env's | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
# setting PYENV_ROOT | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc | |
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc | |
source ~/.zshrc | |
## plugin for making virtual envv via pyenv | |
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv | |
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc | |
## Install python 3.8.0 | |
pyenv install 3.8.0 | |
# Install autoenv | |
git clone https://github.com/Tarrasch/zsh-autoenv ~/.dotfiles/lib/zsh-autoenv | |
echo 'source ~/.dotfiles/lib/zsh-autoenv/autoenv.zsh' >> ~/.zshrc | |
source ~/.zshrc | |
# Auto suggestion | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
# and add `plugins=(zsh-autosuggestions)` into .zshrc | |
# Or | |
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions | |
echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc | |
source ~/.zshrc | |
# Syntax highlighting | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
# and activate plugin Activate the plugin in ~/.zshrc -> plugins=( [plugins...] zsh-syntax-highlighting) | |
# Or do it manually | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting | |
echo 'source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc | |
source ~/.zshrc | |
## Install postgres | |
sudo apt-get install postgresql -y | |
## Install Java 13 | |
mkdir java_install && cd java_install | |
wget https://download.java.net/openjdk/jdk13/ri/openjdk-13+33_linux-x64_bin.tar.gz | |
tar -xvf openjdk-13+33_linux-x64_bin.tar.gz | |
sudo mv jdk-13 /opt/ | |
echo 'JAVA_HOME="/opt/jdk-13"' >> ~/.zshrc | |
echo 'export PATH="$PATH:$JAVA_HOME/bin"' >> ~/.zshrc | |
java --version | |
cd .. | |
rm -rf java_install | |
## Install maven | |
mkdir maven_install && cd maven_install | |
wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | |
tar -xvf apache-maven-3.6.3-bin.tar.gz | |
sudo mv apache-maven-3.6.3 /opt/ | |
echo 'M2_HOME='/opt/apache-maven-3.6.3'' >> ~/.zshrc | |
echo 'export PATH="$M2_HOME/bin:$PATH"' >> ~/.zshrc | |
source ~/.zshrc | |
cd .. | |
rm -rf maven_install | |
## Install Rust | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | |
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc | |
source ~/.zshrc | |
## Install Node and npm | |
sudo apt install nodejs | |
sudo apt install npm | |
## Install pip | |
sudo apt-get install pip | |
## Install Rust | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment