CentOS7默认的yum源更换为阿里云yum源
Posted 小志的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7默认的yum源更换为阿里云yum源相关的知识,希望对你有一定的参考价值。
参考此博文连接 https://blog.csdn.net/aa867734398/article/details/107968565
1、首先备份/etc/yum.repos.d/目录下默认的yum源
#备份CentOS-Base.repo为CentOS-Base.repo.backup
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载CentOS7环境新的CentOS-Base.repo 到/etc/yum.repos.d/目录下
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、添加epel-7.repo到/etc/yum.repos.d/目录下
[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4、清理yum缓存
[root@localhost ~]# yum clean all
5、重新生成新的yum缓存
[root@localhost ~]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00
epel | 4.7 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
(1/9): epel/x86_64/prestodelta | 727 B 00:00
(2/9): extras/7/x86_64/filelists_db | 235 kB 00:02
(3/9): epel/x86_64/other_db | 3.4 MB 00:05
(4/9): extras/7/x86_64/other_db | 143 kB 00:02
(5/9): base/7/x86_64/filelists_db | 7.2 MB 00:07
(6/9): updates/7/x86_64/other_db | 680 kB 00:01
(7/9): base/7/x86_64/other_db | 2.6 MB 00:07
(8/9): updates/7/x86_64/filelists_db | 5.1 MB 00:03
(9/9): epel/x86_64/filelists_db | 12 MB 00:10
元数据缓存已建立
[root@localhost ~]#
以上是关于CentOS7默认的yum源更换为阿里云yum源的主要内容,如果未能解决你的问题,请参考以下文章