zshをダウンロードしmakeします。
cd $HOME/local
wget https://sourceforge.net/projects/zsh/files/zsh/5.9/zsh-5.9.tar.xz/download -O zsh-5.9.tar.xz
tar xvf zsh-5.9.tar.xz
cd zsh-5.9
./configure --prefix=$HOME/local --enable-multibyte --enable-locale --with-tcsetpgrp
make
make install
.bash_profile
に次のように書き込みます。
# =============================
# シェルと確認と変更
# =============================
# 現在のシェル名を取得
current_shell=$(basename "$SHELL")
if [[ "$current_shell" == bash ]]; then
if [ -x "$(command -v $HOME/local/bin/zsh)" ]; then
exec $HOME/local/bin/zsh
# .zshrcは自動的にsourceされる
else
source $HOME/.bashrc
fi
elif [[ "$current_shell" == zsh ]]; then
: # pass
else
echo "Error! -- Undefined shell: $current_shell"
fi