CentOS7怎么设置成阿里源
参考
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.526b1b11JmhoPC
- 环境查看
系统环境
# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# uname -a
Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- 设置
# 进入源目录
cd /etc/yum.repos.d/
# 备份
mv CentOS-Base.repo CentOS-Base.repo.bak
# 下载源,以下两个命令均可
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 更新缓存
yum makecache
yum update

浙公网安备 33010602011771号