CentOS7基本配置
# 设置中科大源
注意:需要先切换root用户
su -
1
# ===================================
# 镜像源设置开始
# ===================================
# 添加中科大centos7镜像源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak \
&& sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-Base.repo
yum makecache \
&& yum clean all
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 安装开发工具包、系统软件
# 安装epel源
yum install epel-release -y
# 安装DNF
yum install dnf -y
# 安装dnf插件及neofetch
dnf install dnf-plugins-core -y
dnf copr enable konimex/neofetch -y
dnf install neofetch -y
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 安装开发工具
# 安装开发工具
dnf groupinstall "Development Tools" -y
# dnf groupinstall "X Window System" -y \
# && dnf groupinstall xfce -y \
# && dnf install pixman pixman-devel libXfont -y
# 升级git2
dnf install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
-y
dnf remove git -y
dnf install git236 -y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 安装Vim等工具
# 安装其他工具包
dnf install sudo \
vim \
net-tools \
wget \
-y
1
2
3
4
5
6
2
3
4
5
6
# 安装zsh
dnf install zsh -y
1
# 安装on-my-zsh
# 给root用户安装oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc \
&& chsh -s /bin/zsh
# 为普通用户再安装一次oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc
# 添加自定义环境变量
echo "source ~/my_profile.sh" >> ~/.zshrc
chsh -s /bin/zsh
vim ~/my_profile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 参考
编辑 (opens new window)
上次更新: 2023/02/22, 13:47:25
- 01
- 解决css部分border被圆角切掉之后圆角的边框消失问题03-18
- 02
- 使用TypeScript开发一个自定义的Node-js前端开发脚手架03-08
- 03
- Github-Actions使用release-please实现自动发版03-06