CentOS6.8配置阿里yum源


1.cd /etc/yum.repos.d/

進入yum源存放目錄,默認會帶有官方的yum源

2.rm -rf *

因為這些地址都是國外的源,下載時候速度會慢很多,刪掉,下面給它替換成阿里的源

3.wget http://mirrors.aliyun.com/repo/Centos-6.repo

下載阿里的yum源

4.yum clean all

清空一下yum的緩存

5.yum repolist

 查看yum源的列表並自動下載一些相應的元數據存到本地

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM