centos7.5更新yum源和epel

版权声明:褪色的记忆原创,转载请注明出处 https://blog.csdn.net/qq_37259023/article/details/82962180

linux版本:CentOS Linux release 7.5.1804 (Core) 

由于yum一直很慢,所以打算换个国内的yum源,找了阿里云和163的换上去。一直报错

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

网上查了资料,说注解epel.repo文件中的bashurl,经过测试毛用没有。于是找了一个阿里云的epel.repo换了上去。一切正常。

get下载epel.repo文件,已选好路径。如果需要自己可先备份epel.repo文件。

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

如果yum不报错的话,也可在线安装。我的yum报错,所以用wget方式。

yum install epel-release

然后下载yum源,163和阿里云都可,都提供一下地址

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

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

下载完成后运行命令生成缓存

#yum  clean  all
#yum  makecache

ok,一切正常,圆满解决问题!

猜你喜欢

转载自blog.csdn.net/qq_37259023/article/details/82962180