CentOS 7 更换 yum 源
Linux Linux 13

进入yum源配置目录

cd /etc/yum.repos.d

备份原 yum 源基础配置文件

mkdir repo_bak
mv *.repo repo_bak/

下载阿里云的yum源并替换

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

修改错误信息

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

安装epel源

yum install -y epel-release

生成新的yum缓存

yum clean all
yum makecache
CentOS 7 更换 yum 源
https://blog.xiqi.site/archives/centos-7-geng-huan-yum-yuan
作者
管理员
发布于
更新于
许可