把系统默认的yum源改为阿里云(从阿里云里下载软件)

Yum 源

Yum repolist

把系统默认的yum源改为阿里云(从阿里云里下载软件)
[root@oldboyedu50 ~]# yum repolist 查看当前的yun源
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
base: mirrors.aliyun.comm
updates: mirrors.ali
extras: mirrors.aliyun.co
yun.com
epel | 3.2 kB 00:00
epel/primary | 3.2 MB 00:09
epel 12518/12518
repo id repo name status
base CentOS-6 - Base - mirrors.aliyun.com 6,713
epel Extra Packages for Enterprise Linux 6 - x8664 12,518
extras CentOS-6 - Extras - mirrors.aliyun.com 31
updates CentOS-6 - Updates - mirrors.aliyun.com 45
repolist: 19,307 软件包数量

2.1 把系统默认的yum源 改为阿里云(从阿里云里下载软件)
https://opsx.alibaba.com 网址

备份:mv /etc/yum.repos.d/CentOS-Base.repo系统 /etc/yum.repos.d/CentOS-Base.repo.backup
2.2 配置CentOS6yum源 :wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
/etc/yum.repos.d/CentOS-Base.repo系统默认yun的配置文件base extras updates

diff CentOS-Base.repo CentOS-Base.repo.backup
vimdiff CentOS-Base.repo CentOS-Base.repo.backup (vimdiff为了两个对比)

2.3 配置epel:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
[root@oldboyedu50 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
base: mirrors.aliyun.com
extras: mirrors.aliyun.com
updates: mirrors.aliyun.com
epel | 3.2 kB 00:00
repo id repo name status
base CentOS-6 - Base - mirrors.aliyun.com 6,713
epel Extra Packages for Enterprise Linux 12,518
extras CentOS-6 - Extras - mirrors.aliyun.c 31
updates CentOS-6 - Updates - mirrors.aliyun. 45
repolist: 19,307增加后的

2.4 清华:centos点击问号
https://mirrors.tuna.tsinghua.edu.cn/help/centos/
yum clean all #清空yum缓存

猜你喜欢

转载自blog.51cto.com/13860358/2160919