免root安装tmux(一键式脚本)

将下列脚本复制到tmux_install.sh脚本中,然后运行sh tmux_install.sh 就可以免root一键式安装tmux了;

# tumx_install.sh
mkdir  tmux_depend
cd tmux_depend

wget -c https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a.tar.gz
wget -c https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
wget -c https://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz

tar -xzvf tmux-3.0a.tar.gz
tar -xzvf libevent-2.1.11-stable.tar.gz
tar -xzvf ncurses-6.2.tar.gz

cd  libevent-2.1.11-stable
./configure --prefix=$HOME/tmux_depend --disable-shared
make && make install

cd ../ncurses-6.2
./configure --prefix=$HOME/tmux_depend
make && make install


cd ../tmux-3.0a
./configure CFLAGS="-I$HOME/tmux_depend/include -I/$HOME/tmux_depend/include/ncurses" LDFLAGS="-L/$HOME/tmux_depend/lib -L/$HOME/tmux_depend/include/ncurses -L/$HOME/tmux_depend/include"
make
cp tmux  $HOME/tmux_depend/bin

export PATH=$HOME/tmux_depend/bin:$PATH
source ~/.bashrc

echo 'export PATH=$HOME/tmux_depend/bin:$PATH' >>.bashrc
source ~/.bashrc

你可能感兴趣的:(ubuntu,linux,运维)