Skip to content

Instantly share code, notes, and snippets.

@GivenCui

GivenCui/init.sh Secret

Last active September 14, 2019 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GivenCui/2627711996d7fdb2cc411ffcc6323b26 to your computer and use it in GitHub Desktop.
Save GivenCui/2627711996d7fdb2cc411ffcc6323b26 to your computer and use it in GitHub Desktop.
centos环境初始化
#!/bin/bash
# 安装相关依赖库
echo '>>>>>>>>安装相关依赖库和编译工具>>>>>>>> start'
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# 安装编译工具
yum -y install gcc perl-ExtUtils-MakeMaker
echo -e '>>>>>>>>安装相关依赖库和编译工具>>>>>>>> end\n\n'
# 下载并安装git
echo '>>>>>>>>下载并安装git>>>>>>>> start'
# 安装最新版git
# 参考https://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-7-x-6-x
yum -y install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm && yum -y install git
echo -e '>>>>>>>>下载并安装git>>>>>>>> end\n\n'
# 安装oh-my-zsh
echo '>>>>>>>>安装oh-my-zsh>>>>>>>> start'
## 安装zsh, 然后安装oh-my-zsh
yum -y install zsh && sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
## 更改默认shell
chsh -s /bin/zsh
echo -e '>>>>>>>>安装oh-my-zsh>>>>>>>> end\n\n'
# 安装autojump
git clone git://github.com/joelthelion/autojump.git && cd autojump && ./install.py && cd .. && rm -rf autojump
echo "[[ -s /root/.autojump/etc/profile.d/autojump.sh ]] && source /root/.autojump/etc/profile.d/autojump.sh" >> ~/.bashrc
# 安装宝塔linux面板
echo '>>>>>>>>安装宝塔linux面板>>>>>>>> start'
wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
echo -e '>>>>>>>>安装宝塔linux面板>>>>>>>> end\n\n'
# 生效环境变量
source /etc/bashrc
@GivenCui
Copy link
Author

# 查看当前shell
echo $SHELL

# 设置默认shell
chsh -s /bin/zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment