yum源配置,亲测可用
最近在配置yum源发现了各种问题,网上回答太乱了,这里直接分享配置内容,拷贝内容进去即可。注意:针对centos7*版本。
具体步骤:
1、修改yum源文件(注意备份,既然不行也可不备份,麻烦)
cd /etc/yum.repos.d
#下载
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#修改(把下面的内容帖进去即可)
vi CentOS-Base.repo
2、缓存更新
# 清缓存
yum clean all
# 重新缓存
yum makecache
注意:
*1、aliyuncs.com访问不了,直接注释即可
2、$releasever 没法适配上版本,直接全文替换成7
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does