用于软件包管理的21个Linux YUM命令(1)(3)
6. 使用Yum获取软件包信息
假设你想在安装软件包之前先知道它的信息。想获得某软件包的信息,只要执行下面这个命令。
- # yum info firefox
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- * base: mirror.neu.edu.cn
- * epel: mirror.neu.edu.cn
- * extras: mirror.neu.edu.cn
- * rpmforge: mirror.nl.leaseweb.net
- * updates: ftp.iitm.ac.in
- Available Packages
- Name : firefox
- Arch : i386
- Version : 10.0.6
- Release : 1.el5.centos
- Size : 20 M
- Repo : updates
- Summary : Mozilla Firefox Web browser
- URL : http://www.mozilla.org/projects/firefox/
- License : MPLv1.1 or GPLv2+ or LGPLv2+
- Description : Mozilla Firefox is an open-source web browser, designed for standards
- : compliance, performance and portability.
7. 使用Yum列出所有的可用软件包
想列出Yum数据库中所有的可用软件包,使用下面这个命令。
- # yum list | less
8. 使用Yum列出所有的已安装软件包
想列出系统上所有的已安装软件包,只要执行下面这个命令,它会显示所有的已安装软件包。
- # yum list installed | less
9. Yum Provides函数
Yum provides函数用于查找某个特定文件属于哪个软件包。比如说,如果你想知道含有/etc/httpd/conf/httpd.conf文件的软件包的名称。
- # yum provides /etc/httpd/conf/httpd.conf
- Loaded plugins: fastestmirror
- httpd-2.2.3-63.el5.centos.i386 : Apache HTTP Server
- Repo : base
- Matched from:
- Filename : /etc/httpd/conf/httpd.conf
- httpd-2.2.3-63.el5.centos.1.i386 : Apache HTTP Server
- Repo : updates
- Matched from:
- Filename : /etc/httpd/conf/httpd.conf
- httpd-2.2.3-65.el5.centos.i386 : Apache HTTP Server
- Repo : updates
- Matched from:
- Filename : /etc/httpd/conf/httpd.conf
- httpd-2.2.3-53.el5.centos.1.i386 : Apache HTTP Server
- Repo : installed
- Matched from:
- Other : Provides-match: /etc/httpd/conf/httpd.conf
10. 使用Yum检查可用更新版
想找出你系统上有多少已安装软件包有可用更新版,只要使用下面这个命令。
- # yum check-update
11. 使用Yum更新系统
想确保系统版本最新,打上了所有的安全补丁和二进制软件包更新,只要运行下面这个命令。它会为你的系统安装所有最新的补丁和安全更新版。
- # yum update
12. 列出所有的可用群组软件包
在Linux中,软件包数量与特定群组捆绑在一起。你可以安装某个群组,它就会安装属于该群组的所有相关软件包,用不着使用Yum安装单个软件包。比如说,想列出所有的可用群组,只要执行下面这个命令。
- # yum grouplist
- Installed Groups:
- Administration Tools
- DNS Name Server
- Dialup Networking Support
- Editors
- Engineering and Scientific
- FTP Server
- Graphics
- Java Development
- Legacy Network Server
- Available Groups:
- Authoring and Publishing
- Base
- Beagle
- Cluster Storage
- Clustering
- Development Libraries
- Development Tools
- Eclipse
- Educational Software
- KDE (K Desktop Environment)
- KDE Software Development
评论暂时关闭