安装zsh&oh-my-zsh(没有root权限)
想要安装智能丝滑的oh-my-zsh,首先check是否安装了zsh。
zsh --version
若zsh: command not found,则首先需要安装zsh,否则直接跳至step 2。
step 1 安装zsh
# 下载最新的zsh安装包
wget -O zsh.tar.xz https://sourceforge.net/projects/zsh/files/latest/download --no-check-certificate
mkdir zsh && unxz zsh.tar.xz && tar -xvf zsh.tar -C zsh --strip-components 1
cd zsh
# 编译zsh
./configure --prefix=$HOME/zsh
make && make install
# 安装完成后。加入环境变量.bashrc
export PATH=$HOME/zsh/bin:$PATH
# 生效
source ~/.bashrc
# 可能会报错This is probably a library called 'curses' or 'ncurses'.
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz
mkdir ncurses
tar -xvf ncurses-6.0.tar.gz
cd ncurses-6.0
./configure --prefix=$HOME/ncurses --with-shared --without-debug --enable-widec
make && make install
# 安装完成后
export CXXFLAGS="-fPIC"
export CFLAGS="-fPIC"
export NCURSES_HOME=$HOME/ncurses # 这里表示家目录的ncurses目录,可以自己设置一个想要的路径
export PATH=$NCURSES_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NCURSES_HOME/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I$NCURSES_HOME/include" LDFLAGS="-L$NCURSES_HOME/lib"
加入~/.bashrc
source ~/.bashrc
# 然后编译zsh即可
step 2 安装oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
source ~/.zshrc
参考: Linux 非 root 用户安装 zsh, 并用 oh-my-zsh 进行配置 Install zsh without root access?
|