CentOS 7.8更换yum源
CentOS 7.8更换yum源
由于默认yum源地址是国外,下载不方便,将其更新为国内的
备份原有配置
cd /etc/yum.repos.d && cp CentOS-Base.repo CentOS-Base.repo_backup
如何存在epel配置,删除
rm -rf epel*
修改CentOS-Base.repo
如果内核版本不是7.8,查看当前内核信息,将7.8.2003替换,查看内核命令
cat /etc/redhat-release
开始配置
$ vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-$releasever
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-$releasever
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-$releasever
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-$releasever
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-$releasever
更新配置
清除信息yum clean all
,建立元数据缓存yum makecache
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 木子李
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果