Before installing zsh package as your shell in your system, you need to login as a root user in your CentOS system.

Firstly, install the zsh package

yum -y install zsh

After the installation finished, switch the shell from zsh

chsh -s /bin/zsh

After system confirmed your change request, re-login or re-open the shell to get the new shell applied.

Use this following the command to confirm the shell has been switched over.

echo $SHELL

if you got this message return /bin/zsh, that means you had successfully changed the shell to zsh.

Using this command to install the oh-my-zsh package

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

After the processing finished, done!