Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save OndrejValenta/41c4c60f837ccd56c57ba496177676b3 to your computer and use it in GitHub Desktop.
Save OndrejValenta/41c4c60f837ccd56c57ba496177676b3 to your computer and use it in GitHub Desktop.

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
chsh -s /bin/zsh root
echo $SHELL
yum install wget git -y
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

/bin/cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
source ~/.zshrc

@DrjavaB
Copy link

DrjavaB commented Oct 7, 2023

unfortunately encountered this error
in_subnet:18: bad math expression: operand expected at '
in_subnet:9: bad option: -a

@Mohammed-5253
Copy link

If anyone wants ready data for ubuntu, it is here

# Install Zsh
sudo apt-get update
sudo apt-get install zsh -y

# Change the default shell for the root user
sudo chsh -s /bin/zsh root

# Check the default shell for the root user
echo $SHELL

# Install wget and git
sudo apt-get install wget git -y

# Install Oh My Zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Copy the Zsh configuration template
/bin/cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

# Source the Zsh configuration
source ~/.zshrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment