Last active
June 5, 2024 16:27
-
-
Save ZhaofengWu/f345652e994e3b68c309352a7610460f to your computer and use it in GitHub Desktop.
Install zsh without root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# OPTIONAL: zsh will not install without ncurses. IF your machine doesn't have ncurses, you need to install it first. | |
export CXXFLAGS=" -fPIC" CFLAGS=" -fPIC" CPPFLAGS="-I${HOME}/include" LDFLAGS="-L${HOME}/lib" | |
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz | |
tar -xzvf ncurses-6.2.tar.gz | |
cd ncurses-6.2 | |
./configure --prefix=$HOME --enable-shared | |
make | |
make install | |
cd .. && rm ncurses-6.2.tar.gz && rm -r ncurses-6.2 | |
# install zsh itself | |
wget -O zsh.tar.xz https://sourceforge.net/projects/zsh/files/latest/download | |
mkdir zsh && unxz zsh.tar.xz && tar -xvf zsh.tar -C zsh --strip-components 1 | |
cd zsh | |
./configure --prefix=$HOME | |
make | |
make install | |
cd .. && rm zsh.tar && rm -r zsh | |
echo -e "export SHELL=~/bin/zsh\nexec ~/bin/zsh -l" >> ~/.bash_profile # or chsh | |
# OPTIONAL: install oh-my-zsh | |
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" |
Sorry I don't know what causes this :(
Thanks for the script! Works like a charm :)
Works perfectly, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script more or less worked. My group has multiple machines with different configurations, however for all the machines the $HOME directory is the same.
oh-my-zsh
works perfectly fine when I ssh to one of the inferior machine, but when I ssh to one of the powerful machines for actual computation the following error occurs:Do you have any solution for this?