配置阿里源配置文件
- 备份阿里源配置文件
[wanchao@localhost ~]$ mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Centos-Base.repo.bak
- 下载阿里源配置文件(2种方式)
[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]#curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
- 更新镜像源
-清除yum缓存
[wanchao@localhost ~]$ yum clean all
-生成yum缓存
[wanchao@localhost ~]$ yum makecache
#1、修改yum配置文件
[wanchao@localhost ~]$ vim /etc/yum.repos.d/CentOS-Base.repo
#2、将全文中所有的“$releasever”字符串替换成“7”,因为我的系统centos7版本
#进入命令行模式
:%s/$releasever/7/g
#保存并退出
:wq
- 再次更新镜像源
[wanchao@localhost ~]$ yum clean all
[wanchao@localhost ~]$ yum makecache
网友评论