配置yum源为阿里云yum源

配置yum源为阿里云yum源

配置yum仓库
禁用 yum插件 fastestmirror

  1. 修改插件的配置文件
[root@lamp ~]# cp /etc/yum/pluginconf.d/fastestmirror.conf /etc/yum/pluginconf.d/fastestmirror.conf.bak		# 备份源文件
[root@lamp ~]# vim /etc/yum/pluginconf.d/fastestmirror.conf	# 修改
enabled = 1         //由1改为0,禁用该插件
  1. 修改yum的配置文件
[root@lamp ~]# cp /etc/yum.conf /etc/yum.conf.bak
[root@lamp ~]# vim /etc/yum.conf
plugins =1         //改为0,不使用插件

获取阿里云 repo

[root@lamp ~]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

[root@lamp ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[root@lamp ~]# cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
[root@lamp ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

清理原来的缓存,重新缓存

[root@lamp ~]# yum clean all

[root@lamp ~]# yum makecache

[root@lamp ~]# yum repolist

猜你喜欢

转载自blog.csdn.net/Cantevenl/article/details/115173952