rpm + 如何识别在安装操作系统时某些 rpm 是否被删除或未安装

rpm + 如何识别在安装操作系统时某些 rpm 是否被删除或未安装

我们有 rhel 7.6 机器

我们注意到某些特定的 rpm 没有安装在机器上

问题是我们不确定是否有人通过yum remove或删除它rpm -i

或者

简单地说,当从头安装操作系统时,rpm 从一开始就没有安装

如果 rpm 没有随操作系统一起安装,我们该怎么做?

或者 rpm 被某人删除了?

答案1

您可以使用它yum history来查找有关软件包安装、升级或删除的详细信息。

yum history list <package>将给出摘要并yum history info <package>给出非常详细的信息。

例如:

[root@vmtest-centos7 ~]# yum history list htop
Loaded plugins: fastestmirror
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     7 | -d 2 -y install tmux tra | 2019-12-04 03:33 | I, U           |   49   
history list

如果需要更多详细信息:

[root@vmtest-centos7 ~]# yum history info htop
Loaded plugins: fastestmirror
Transaction ID : 7
Begin time     : Wed Dec  4 03:33:25 2019
Begin rpmdb    : 307:6c41312854623ca5d949e51faa4fef289e20f91d
End time       :            03:33:42 2019 (17 seconds)
End rpmdb      : 355:8d69d977579cbfe95784e897827e8897b00a5260
User           :  <ansible>
Return-Code    : Success
Command Line   : -d 2 -y install tmux traceroute wget vim-enhanced psmisc bind-utils unzip lsof pv bzip2 htop bash-completion tar epel-release rsyslog
Transaction performed with:
    Updated       rpm-4.11.3-40.el7.x86_64                      @anaconda
    Updated       yum-3.4.3-163.el7.centos.noarch               @anaconda
    Updated       yum-plugin-fastestmirror-1.1.31-52.el7.noarch @anaconda
Packages Altered:
    Dep-Install GeoIP-1.5.0-14.el7.x86_64                  @base
    Install     bash-completion-1:2.1-6.el7.noarch         @base
    Dep-Install bind-libs-32:9.11.4-9.P2.el7.x86_64        @base
    Dep-Install bind-libs-lite-32:9.11.4-9.P2.el7.x86_64   @base
    Dep-Install bind-license-32:9.11.4-9.P2.el7.noarch     @base
    Install     bind-utils-32:9.11.4-9.P2.el7.x86_64       @base
    Install     bzip2-1.0.6-13.el7.x86_64                  @base
    Updated     epel-release-7-11.noarch                   @extras
    Update                   7-12.noarch                   @epel
    Dep-Install geoipupdate-2.5.0-1.el7.x86_64             @base
    Dep-Install gpm-libs-1.20.7-6.el7.x86_64               @base
    Install     htop-2.2.0-3.el7.x86_64                    @epel
    Dep-Install libevent-2.0.21-4.el7.x86_64               @base
    Install     lsof-4.87-6.el7.x86_64                     @base
    Dep-Install perl-4:5.16.3-294.el7_6.x86_64             @base
    Dep-Install perl-Carp-1.26-244.el7.noarch              @base
    Dep-Install perl-Encode-2.51-7.el7.x86_64              @base
    Dep-Install perl-Exporter-5.68-3.el7.noarch            @base
    Dep-Install perl-File-Path-2.09-2.el7.noarch           @base
    Dep-Install perl-File-Temp-0.23.01-3.el7.noarch        @base
    Dep-Install perl-Filter-1.49-3.el7.x86_64              @base
    Dep-Install perl-Getopt-Long-2.40-3.el7.noarch         @base
    Dep-Install perl-HTTP-Tiny-0.033-3.el7.noarch          @base
    Dep-Install perl-PathTools-3.40-5.el7.x86_64           @base
    Dep-Install perl-Pod-Escapes-1:1.04-294.el7_6.noarch   @base
    Dep-Install perl-Pod-Perldoc-3.20-4.el7.noarch         @base
    Dep-Install perl-Pod-Simple-1:3.28-4.el7.noarch        @base
    Dep-Install perl-Pod-Usage-1.63-3.el7.noarch           @base
    Dep-Install perl-Scalar-List-Utils-1.27-248.el7.x86_64 @base
    Dep-Install perl-Socket-2.010-4.el7.x86_64             @base
    Dep-Install perl-Storable-2.45-3.el7.x86_64            @base
    Dep-Install perl-Text-ParseWords-3.29-4.el7.noarch     @base
    Dep-Install perl-Time-HiRes-4:1.9725-3.el7.x86_64      @base
    Dep-Install perl-Time-Local-1.2300-2.el7.noarch        @base
    Dep-Install perl-constant-1.27-2.el7.noarch            @base
    Dep-Install perl-libs-4:5.16.3-294.el7_6.x86_64        @base
    Dep-Install perl-macros-4:5.16.3-294.el7_6.x86_64      @base
    Dep-Install perl-parent-1:0.225-244.el7.noarch         @base
    Dep-Install perl-podlators-2.5.1-3.el7.noarch          @base
    Dep-Install perl-threads-1.87-4.el7.x86_64             @base
    Dep-Install perl-threads-shared-1.43-6.el7.x86_64      @base
    Install     psmisc-22.20-16.el7.x86_64                 @base
    Install     pv-1.4.6-1.el7.x86_64                      @epel
    Install     tmux-1.8-4.el7.x86_64                      @base
    Install     traceroute-3:2.0.22-2.el7.x86_64           @base
    Install     unzip-6.0-20.el7.x86_64                    @base
    Dep-Install vim-common-2:7.4.629-6.el7.x86_64          @base
    Install     vim-enhanced-2:7.4.629-6.el7.x86_64        @base
    Dep-Install vim-filesystem-2:7.4.629-6.el7.x86_64      @base
    Install     wget-1.14-18.el7_6.1.x86_64                @base
history info

您还可以指定您感兴趣的交易的 ID 号,例如yum history info 7

相关内容