美文网首页
Centos 7--更新yum源

Centos 7--更新yum源

作者: 热爱_生活 | 来源:发表于2020-04-27 15:26 被阅读0次

更新yum源

cd /etc/yum.repos.d

备份一下原来的yum源

mv CentOS-Base.repo{,.bak}

下载新的CentOS-Base.repo 到/etc/yum.repos.d/
如下的源用一个就好,三条命令选其一

//更新为阿里云的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//更新为163的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

//更新为搜狐的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

运行yum makecache生成缓存

yum clean all
yum makecache

相关文章

网友评论

      本文标题:Centos 7--更新yum源

      本文链接:https://www.haomeiwen.com/subject/hhaywhtx.html