centos6換阿里源/華為源


1.備份原來的源文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.換源

阿里源:

[root@linux ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
--2019-07-10 01:22:45--  http://mirrors.aliyun.com/repo/Centos-6.repo
正在解析主機 mirrors.aliyun.com... 115.223.14.213, 122.225.67.224, 115.223.14.214, ...
正在連接 mirrors.aliyun.com|115.223.14.213|:80... 已連接。
已發出 HTTP 請求,正在等待回應... 200 OK
長度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

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

2019-07-10 01:22:50 (312 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523]

華為源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-6-anon.repo

詳見華為雲官網說明:https://mirrors.huaweicloud.com

3.清理

[root@linux ~]# yum clean all
已加載插件:fastestmirror, refresh-packagekit, security
Cleaning repos: base extras updates
清理一切
Cleaning up list of fastest mirrors

4.生成緩存

[root@linux ~]# yum makecache
已加載插件: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/group_gz                                                                   | 242 kB     00:00     
base/filelists_db                                                               | 6.4 MB     00:00     
base/primary_db                                                                 | 4.7 MB     00:00     
base/other_db                                                                   | 2.8 MB     00:00     
extras                                                                          | 3.4 kB     00:00     
extras/filelists_db                                                             |  24 kB     00:00     
extras/prestodelta                                                              | 2.2 kB     00:00     
extras/primary_db                                                               |  29 kB     00:00     
extras/other_db                                                                 |  14 kB     00:00     
updates                                                                         | 3.4 kB     00:00     
updates/filelists_db                                                            | 3.6 MB     00:00     
updates/prestodelta                                                             | 175 kB     00:00     
updates/primary_db                                                              | 5.1 MB     00:00     
updates/other_db                                                                | 249 kB     00:00     
元數據緩存已建立

 


免責聲明!

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



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