如何列出最近的 yum 更新

如何列出最近的 yum 更新

昨晚我将我的一个 RedHat 系统从 6.1 更新到了 6.2。有几百个更新。

如何列出最近应用于系统的更新?我试过了,yum list recent但只显示

Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
Recently Added Packages
Red_Hat_Enterprise_Linux-Release_Notes-6-as-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-bn-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-de-DE.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch                 2-22.el6_2                 rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-es-ES.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-fr-FR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-gu-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-hi-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-it-IT.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ja-JP.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-kn-IN.noarch                 2-8.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ko-KR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ml-IN.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-mr-IN.noarch                 2-10.el6_2                 rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-or-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-pa-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-pt-BR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ru-RU.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-te-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-zh-CN.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-zh-TW.noarch                 2-4.el6_2                  rhel-x86_64-server-6
rng-tools.x86_64                                                      2-13.el6_2                 rhel-x86_64-server-6

答案1

这应该可以。

rpm -qa --qf '%{INSTALLTIME} %-40{NAME} %{INSTALLTIME:date}\n' | sort -n | cut -d' ' -f2-

它将查询所有已安装的 RPM 软件包 ( rpm -qa),并使用以下格式 ( --qf) 打印它们:首先是安装时间(以自纪元以​​来的秒数表示%{INSTALLTIME}),然后是软件包名称(40 个字符字段,左对齐%-40{NAME}),然后是安装时间(日期和时间格式)(%{INSTALLTIME:date})。结果按第一个时间字段排序,然后删除该时间字段。

答案2

只需这样就能显示足够多的内容(显示最后 30 条):

rpm -qa --last|head -30

相关内容