CentOS 、Linux 配置国内阿里源、yum源镜像

1.备份原来的yum源

[root@localhost conf]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  CentOS-x86_64-kernel.repo
[root@localhost yum.repos.d]# mkdir yum
[root@localhost yum.repos.d]# mv *.repo yum

2.下载阿里源镜像

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

3.清理原来的缓存更新阿里源

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
[root@localhost yum.repos.d]# yum -y install epel-release

查看安装的源

[root@localhost yum.repos.d]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
源标识                                                                     源名称                                                                                                   状态
base/7/x86_64                                                              CentOS-7 - Base - mirrors.aliyun.com                                                                     10,072
epel/x86_64                                                                Extra Packages for Enterprise Linux 7 - x86_64                                                           13,758
extras/7/x86_64                                                            CentOS-7 - Extras - mirrors.aliyun.com                                                                      512
updates/7/x86_64                                                           CentOS-7 - Updates - mirrors.aliyun.com                                                                   4,053
repolist: 28,395

你可能感兴趣的:(linux,centos,服务器)