Yum 相關操做

  1. 更改默認數據源到163
#首先備份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#下載163數據源
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@localhost yum.repos.d]# ls -lh
total 32K
-rw-r--r--  1 root root 2.0K Sep 18  2014 CentOS6-Base-163.repo
-rw-r--r--. 1 root root 1.7K Dec  9  2015 CentOS-Base.repo.backup
-rw-r--r--. 1 root root 1.3K Dec  9  2015 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Dec  9  2015 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  290 Dec  9  2015 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 Dec  9  2015 CentOS-Media.repo
-rw-r--r--. 1 root root 1.3K Dec  9  2015 CentOS-Sources.repo
-rw-r--r--. 1 root root 2.0K Dec  9  2015 CentOS-Vault.repo
#運行yum makecache生成緩存
[root@localhost yum.repos.d]#  yum makecache
Loaded plugins: fastestmirror
base                                                                                                                                                    | 3.6 kB  00:00:00     
extras                                                                                                                                                  | 3.4 kB  00:00:00     
updates                                                                                                                                                 | 3.4 kB  00:00:00     
(1/8): extras/7/x86_64/prestodelta                                                                                                                      | 117 kB  00:00:00     
(2/8): extras/7/x86_64/filelists_db                                                                                                                     | 926 kB  00:00:00     
(3/8): extras/7/x86_64/other_db                                                                                                                         | 755 kB  00:00:00     
(4/8): updates/7/x86_64/prestodelta                                                                                                                     | 880 kB  00:00:00     
(5/8): base/7/x86_64/other_db                                                                                                                           | 2.4 MB  00:00:01     
(6/8): base/7/x86_64/filelists_db                                                                                                                       | 6.6 MB  00:00:06     
(7/8): updates/7/x86_64/filelists_db                                                                                                                    | 4.0 MB  00:00:09     
(8/8): updates/7/x86_64/other_db                                                                                                                        |  84 MB  00:00:35     
Loading mirror speeds from cached hostfile
Metadata Cache Created
#更新系統
[root@localhost yum.repos.d]# yum -y update
相關文章
相關標籤/搜索