前言
这次老师突然要我帮忙配一下服务器的镜像源,装一下docker。刚好又在CentOS 7.9 生命周期结束EOL的时候,花了1个小时找了些资料+完成任务😃
环境
- CentOS 7.9 2009
- Xshell 8.0beta(公测)
安装步骤
1. 尝试使用yum(应该是不成功的)
2. 配置阿里镜像源
我从可用镜像源找到了阿里镜像源配置方法,步骤如下(有需要可以配置其他的源):
切换repo目录,备份镜像源
cd /etc/yum.repo.d/
mkdir backup
mv *.repo backup
ls
上述命令执行完毕后应当只有一个backup,我这里是复盘写的文档。
配置阿里源
cat > CentOS-aliyun-lhr.repo << 'EOF'
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirro