yum命令

環境:RHEL6.8

1、yum repolist all  列出所有倉庫

[root@bogon yum.repos.d]# pwd
/etc/yum.repos.d
[root@bogon yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 1886 Feb  8 15:27 CentOS6-Base-163.repo
-rw-r--r--. 1 root root   86 Feb  8 00:43 local.repo
-rw-r--r--. 1 root root  358 Feb  8 15:28 redhat.repo
[root@bogon yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
repo id                             repo name                                              status
base                                CentOS-6.8 - Base - 163.com                            5,062
extras                              CentOS-6.8 - Extras - 163.com                             39
local_server                        this is a DVD local repo                               5,062
updates                             CentOS-6.8 - Updates - 163.com                           639
repolist: 10,802

2、yum list all  列出倉庫所有軟件

[root@bogon yum.repos.d]# yum list all |more
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
Installed Packages
MAKEDEV.i686                               3.24-6.el6                    @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
acl.i686                                   2.2.49-6.el6                  @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
aic94xx-firmware.noarch                    30-2.el6                      @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
atmel-firmware.noarch                      1.3-7.el6                     @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
attr.i686                                  2.4.44-7.el6                  @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
audit.i686                                 2.4.5-3.el6                   @anaconda-RedHatEnterpriseLinux-201604140956.i386/6.8
......................

3、yum clean all  清除所有倉庫緩存

[root@bogon yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: base extras local_server updates
Cleaning up Everything
Cleaning up list of fastest mirrors

4、yum makecache   將服務器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度

[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Determining fastest mirrors
base                                                                      | 3.7 kB     00:00     
base/group_gz                                                             | 220 kB     00:00     
base/filelists_db                                                         | 5.3 MB     00:00     
base/primary_db                                                           | 3.7 MB     00:00     
base/other_db                                                             | 2.1 MB     00:00     
extras                                                                    | 3.3 kB     00:00     
extras/filelists_db                                                       |  35 kB     00:00     
extras/prestodelta                                                        |   78 B     00:00     
extras/primary_db                                                         |  30 kB     00:00     
extras/other_db                                                           |  46 kB     00:00     
local_server                                                              | 4.0 kB     00:00 ...
local_server/group_gz                                                     | 220 kB     00:00 ...
local_server/filelists_db                                                 | 5.2 MB     00:00 ...
local_server/primary_db                                                   | 3.7 MB     00:00 ...
local_server/other_db                                                     | 2.1 MB     00:00 ...
updates                                                                   | 3.4 kB     00:00     
updates/filelists_db                                                      | 2.4 MB     00:00     
updates/prestodelta                                                       | 261 kB     00:00     
updates/primary_db                                                        | 4.1 MB     00:00     
updates/other_db                                                          |  51 MB     00:20     
Metadata Cache Created

5、yum update          升級所有包,改變軟件設置和系統設置,系統版本內核都升級
      yum -y upgrade   升級所有包,不改變軟件設置和系統設置,系統版本升級,內核不改變

6、yum check-update  檢查可用的更新包

7、yum install              安裝軟件包

8、yum reinstal            重新安裝軟件包

9、yum remove            移除卸載軟件包

10、yum groupinstall    安裝指定的軟件包組

11、yum groupremove  移除指定的軟件包組

12、yum groupinfo       查詢指定的軟件包組信息

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章