centos修改yum源为阿里云

Step 1

1.备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
进入yum文件夹
cd /etc/yum.repos.d
下载阿里源的文件
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo	 
安装epel repo源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

Step 2

清理缓存
yum clean all
重新生成缓存
yum makecache
更新
yum update

163源
wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

转载至https://blog.csdn.net/weixin_43336281/article/details/99691274

posted @ 2021-03-23 17:10  kingdoms  阅读(63)  评论(0)    收藏  举报