环境: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 查询指定的软件包组信息