是否有一些简单的YUM命令,所以我可以知道什么是当前和什么是未来版本的包更新。
我现在谈到:
yum list updates
但是,只打印新版本的软件包…
要列出所有已安装的软件包,可以使用:
# yum list installed
对于特定的包,试试这个:
# yum info httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.vietoss.com * epel: ftp.cuhk.edu.hk * extras: mirror.vietoss.com * rpmforge: ftp-stud.fht-esslingen.de * updates: mirror.vietoss.com Installed Packages Name : httpd Arch : x86_64 Version : 2.2.3 Release : 43.el5.centos Size : 3.3 M Repo : installed Summary : Apache HTTP Server URL : http://httpd.apache.org/ License : Apache Software License Description: The Apache HTTP Server is a powerful, efficient, and extensible : web server. Available Packages Name : httpd Arch : x86_64 Version : 2.2.3 Release : 53.el5.centos.3 Size : 1.2 M Repo : updates Summary : Apache HTTP Server URL : http://httpd.apache.org/ License : Apache Software License Description: The Apache HTTP Server is a powerful, efficient, and extensible : web server.
# yum list httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.vietoss.com * epel: ftp.cuhk.edu.hk * extras: mirror.vietoss.com * rpmforge: ftp-stud.fht-esslingen.de * updates: mirror.vietoss.com Installed Packages httpd.x86_64 2.2.3-43.el5.centos installed Available Packages httpd.x86_64 2.2.3-53.el5.centos.3 updates
如果你想更多的脚本,可能会更容易直接离开rpm。 您可以通过执行以下命令来获取已安装的软件包及其版本的列表: rpm -qa --queryformat "%{NAME} %{VERSION}\n" 。
您可以运行rpm --querytags来查找所有可以放入%{VARIABLES}的内容。 这个格式需要像printf这样的参数(例如\ n换行符,\ t代表tab)。