5、显示包组的信息:列出组中包含的程序包列表(如果包组名中含有空格必须用“”引起来)
yum groupinfo "GROUP NAME"
[root@CentOS6 yum.repos.d]# yum groupinfo "Development Tools" #显示开发工具包组的信息
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Group Process
Loading mirror speeds from cached hostfile
Group: Development tools
Description: A basic development environment.
Mandatory Packages:
autoconf
...
Default Packages:
byacc
...
Optional Packages:
ElectricFence
...
CentOS6 跟开发相关的包组有: Development Tools、Server Platform Development、 Desktop Platform Development
6、清理缓存
yum clean {all|packages|metadata|expire-cache|rpmdb|plugins}
yum clean all 清除缓存目录(/var/cache/yum)下的软件包以及旧的元数据
[root@CentOS6 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: c6-cd
Cleaning up Everything
Cleaning up list of fastest mirrors
7、安装程序包
yum install package_name {-y} -y:自动回答为yes,执行过程中无需等待用户再次输入
[root@CentOS6 yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
c6-cd | 4.0 kB 00:00 ...
c6-cd/primary_db | 3.4 MB 00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i686 0:2.2.15-29.el6.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================
Package Arch Version Repository Size
=================================================================================
Installing:
httpd i686 2.2.15-29.el6.centos c6-cd 828 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 828 k
Installed size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
gnome-user-share-2.28.2-3.el6.i686 has missing requires of httpd >= ('0', '2.2.0', None)
Installing : httpd-2.2.15-29.el6.centos.i686 1/1
Verifying : httpd-2.2.15-29.el6.centos.i686 1/1
Installed:
httpd.i686 0:2.2.15-29.el6.centos
Complete!
重新安装:
yum reinstall package_name
8、升级
yum check-update: 检查可用的升级包
yum update package_name 升级,当不指定版本时,默认升级到最新版本
yum downgrade package_name 降价到指定版本
9、卸载(卸载时为解决该包安装的依赖关系而安装的包也会一同卸载)
yum remove|erase package_name {-y} -y:自动回答为yes,执行过程中无需等待用户再次输入
10、查询某文件是由哪个包安装生成的
yum whatprovides|provides /path/to/somefile
[root@CentOS6 yum.repos.d]# yum provides /usr/bin/zip #查询出zip文件是由那个包安装生成;
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
zip-3.0-1.el6.i686 : A file compression and packaging utility compatible with PKZIP
Repo : c6-cd
Matched from:
Filename : /usr/bin/zip
zip-3.0-1.el6.i686 : A file compression and packaging utility compatible with PKZIP
Repo : installed
Matched from:
Other : Provides-match: /usr/bin/zip