export ZSH_HOME=/opt/zsh-5.9
wget https://sourceforge.net/projects/zsh/files/zsh/5.9/zsh-5.9.tar.xz/download
tar -xvJf download
mv zsh-5.9 zsh-5.9-src && cd zsh-5.9-src
./configure --prefix=$ZSH_HOME
make -j `nproc` && make install
Put $ZSH_HOME/bin/zsh
to the shell list of in /etc/shells
, then chsh
for the current user:
chsh -s $ZSH_HOME/bin/zsh