6. 使用Yum获取软件包信息

假设你想在安装软件包之前先知道它的信息。想获得某软件包的信息,只要执行下面这个命令。

  1. # yum info firefox 
  2. Loaded plugins: fastestmirror 
  3. Loading mirror speeds from cached hostfile 
  4. * base: mirror.neu.edu.cn 
  5. * epel: mirror.neu.edu.cn 
  6. * extras: mirror.neu.edu.cn 
  7. * rpmforge: mirror.nl.leaseweb.net 
  8. * updates: ftp.iitm.ac.in 
  9. Available Packages 
  10. Name      : firefox 
  11. Arch       : i386 
  12. Version     : 10.0.6 
  13. Release     : 1.el5.centos 
  14. Size        : 20 M 
  15. Repo       : updates 
  16. Summary    : Mozilla Firefox Web browser 
  17. URL       : http://www.mozilla.org/projects/firefox/ 
  18. License     : MPLv1.1 or GPLv2+ or LGPLv2+ 
  19. Description  : Mozilla Firefox is an open-source web browser, designed for standards 
  20. : compliance, performance and portability. 

7. 使用Yum列出所有的可用软件包

想列出Yum数据库中所有的可用软件包,使用下面这个命令。

  1. # yum list | less 

8. 使用Yum列出所有的已安装软件包

想列出系统上所有的已安装软件包,只要执行下面这个命令,它会显示所有的已安装软件包。

  1. # yum list installed | less 

9. Yum Provides函数

Yum provides函数用于查找某个特定文件属于哪个软件包。比如说,如果你想知道含有/etc/httpd/conf/httpd.conf文件的软件包的名称。

  1. # yum provides /etc/httpd/conf/httpd.conf 
  2. Loaded plugins: fastestmirror 
  3. httpd-2.2.3-63.el5.centos.i386 : Apache HTTP Server 
  4. Repo        : base 
  5. Matched from: 
  6. Filename    : /etc/httpd/conf/httpd.conf 
  7. httpd-2.2.3-63.el5.centos.1.i386 : Apache HTTP Server 
  8. Repo        : updates 
  9. Matched from: 
  10. Filename    : /etc/httpd/conf/httpd.conf 
  11. httpd-2.2.3-65.el5.centos.i386 : Apache HTTP Server 
  12. Repo        : updates 
  13. Matched from: 
  14. Filename    : /etc/httpd/conf/httpd.conf 
  15. httpd-2.2.3-53.el5.centos.1.i386 : Apache HTTP Server 
  16. Repo        : installed 
  17. Matched from: 
  18. Other       : Provides-match: /etc/httpd/conf/httpd.conf 

10. 使用Yum检查可用更新版

想找出你系统上有多少已安装软件包有可用更新版,只要使用下面这个命令。

  1. # yum check-update 

11. 使用Yum更新系统

想确保系统版本最新,打上了所有的安全补丁和二进制软件包更新,只要运行下面这个命令。它会为你的系统安装所有最新的补丁和安全更新版。

  1. # yum update 

12. 列出所有的可用群组软件包

在Linux中,软件包数量与特定群组捆绑在一起。你可以安装某个群组,它就会安装属于该群组的所有相关软件包,用不着使用Yum安装单个软件包。比如说,想列出所有的可用群组,只要执行下面这个命令。

  1. # yum grouplist 
  2. Installed Groups: 
  3. Administration Tools 
  4. DNS Name Server 
  5. Dialup Networking Support 
  6. Editors 
  7. Engineering and Scientific 
  8. FTP Server 
  9. Graphics 
  10. Java Development 
  11. Legacy Network Server 
  12. Available Groups: 
  13. Authoring and Publishing 
  14. Base 
  15. Beagle 
  16. Cluster Storage 
  17. Clustering 
  18. Development Libraries 
  19. Development Tools 
  20. Eclipse 
  21. Educational Software 
  22. KDE (K Desktop Environment) 
  23. KDE Software Development 


相关内容