1. 当前位置:网站首页 > 技术分享 > 系统

CentOS6.8配置阿里yum源|CentOS6系列配置阿里yum源

1.进入yum源存放目录,默认会带有官方的yum源

cd /etc/yum.repos.d/


2.因为这些地址都是国外的源,下载时候速度会慢很多,删掉,下面给它替换成阿里的源

rm -rf *


3.下载阿里的yum源

wget http://mirrors.aliyun.com/repo/Centos-6.repo
或者用 wget https://www.90175.com/file/repo/aliyun/Centos-6.repo

4.清空一下yum的缓存

yum clean all
yum makecache


5.查看yum源的列表并自动下载一些相应的元数据存到本地(这个可以不操作)

yum repolist

 

6.下面就可以 使用 新的源了

yum -y install 软件名称


运行参考:


[root@centos ~]# cd /etc/yum.repos.d/
[root@centos yum.repos.d]# ll
total 24
-rw-r--r--. 1 root root 1991 May 19  2016 CentOS-Base.repo
-rw-r--r--. 1 root root  647 May 19  2016 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  289 May 19  2016 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 May 19  2016 CentOS-Media.repo
-rw-r--r--. 1 root root 6259 May 19  2016 CentOS-Vault.repo
[root@centos yum.repos.d]# rm -rf *
[root@centos yum.repos.d]# ll
total 0
[root@centos yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-6.repo
--2020-03-22 15:30:38--  http://mirrors.aliyun.com/repo/Centos-6.repo
Resolving mirrors.aliyun.com... 218.98.31.243, 153.99.248.242, 218.98.31.244, ...
Connecting to mirrors.aliyun.com|218.98.31.243|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: “Centos-6.repo”

100%[==============================================================================================================================>] 2,523       --.-K/s   in 0s      

2020-03-22 15:30:39 (336 MB/s) - “Centos-6.repo” saved [2523/2523]

[root@centos yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 2523 Jun 16  2018 Centos-6.repo
[root@centos yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@centos yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                             | 3.7 kB     00:00     
base/primary_db                                                                                                                                  | 4.7 MB     00:03     
extras                                                                                                                                           | 3.4 kB     00:00     
extras/primary_db                                                                                                                                |  29 kB     00:00     
updates                                                                                                                                          | 3.4 kB     00:00     
updates/primary_db                                                                                                                               | 8.9 MB     00:08     
repo id                                                          repo name                                                                                        status
base                                                             CentOS-6 - Base - mirrors.aliyun.com                                                             6,713
extras                                                           CentOS-6 - Extras - mirrors.aliyun.com                                                              47
updates                                                          CentOS-6 - Updates - mirrors.aliyun.com                                                            935
repolist: 7,695


本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://90175.com/wenku/txtlist_i33v.html

联系我们

在线咨询:点击这里给我发消息

微信号:76891828

工作日:9:30-18:30,节假日休息