CentOS7 更新yum源

备份

cd /etc/yum.repos.d/
mkdir repo_bak
mv *.repo repo_bak/

下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all 清除缓存,运行 yum makecache 生成新的缓存

yum clean all
yum makecache

安装EPEL(Extra Packages for Enterprise Linux )源

yum install -y epel-release

再次运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

查看启用的yum源和所有的yum源

yum repolist enabled
yum repolist all

更新yum

yum -y update
posted @ 2020-10-27 15:11  cchilei  阅读(18170)  评论(0编辑  收藏  举报