CentOS7 系统配置国内 yum 源和 epel 源
blank
blank
发布于 2019-03-13 / 471 阅读 / 0 评论 / 0 点赞

CentOS7 系统配置国内 yum 源和 epel 源

备份并打包原 repo 源到/home 然后删除

zip /home/centos7-repo.zip /etc/yum.repos.d/*
rm -rf /etc/yum.repos.d/*

centos-zip-repo

添加阿里 repo && epel 源

wget -O /etc/yum.repos.d/CentOS-Base-aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel-aliyun.repo https://mirrors.aliyun.com/repo/epel-7.repo

centos-add-aliyun-repo

清除系统yum缓存,并重新生成新的yum缓存

yum clean all && yum makecache

centos-yum-clean-all-and-yum-makecache

查看系统可用的yum源和所有的yum源

yum repolist enabled

centos-yum-repolist-enabled

以上操作也能解决重复源问题 yum repository is listed more than once

centos-yum-repository-base-is-listed-more-than-once

DONE


评论