背景
CentOS 7.3 系统上突然从出了个 iscsiadm 命令,确认:是哪个时间,安装什么包时把这个 iscsiadm 安装上了。
查看哪个 package 包含了 iscsiadm 命令
[root@node ~]$ sudo yum provides iscsiadm
iscsi-initiator-utils-6.2.0.873-35.el7.i686 : iSCSI daemon and utility programs
Repo : base
Matched from:
Filename : /usr/sbin/iscsiadm
查看yum操作历史
[root@node ~]# yum history list
Loaded plugins: fastestmirror
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
11 | root <root> | 2017-08-15 14:10 | Erase | 7
10 | root <root> | 2017-08-10 11:53 | Install | 1
9 | root <root> | 2017-08-02 10:35 | Install | 3
8 | root <root> | 2017-08-02 10:32 | I, U | 105 EE
7 | root <root> | 2017-08-02 10:25 | Install | 1
6 | root <root> | 2017-06-20 15:55 | Install | 1
5 | root <root> | 2017-06-02 09:18 | Install | 1
4 | root <root> | 2017-06-02 09:16 | Install | 1
3 | root <root> | 2017-05-18 16:42 | Install | 5
2 | root <root> | 2017-05-07 09:49 | Install | 18 P<
1 | System <unset> | 2017-04-10 05:14 | Install | 297 >
history list
查看哪个操作安装了iscsi-initiator-utils
一个个查看 yum 每次安装的详情,最后在发现在安装 libguestfs package 时 Packages Altered 有安装 iscsi-initiator-utils。
[root@node ~]# yum history info 8|less
Loaded plugins: fastestmirror
Transaction ID : 8
Begin time : Wed Aug 2 10:32:24 2017
Begin rpmdb : 420:14f62c2a6db5374b48003fad8a4575bfac1952cf
End time : 10:32:56 2017 (32 seconds)
End rpmdb : 523:90edbd527403d27a62cf1716cf25dcf5c874763c
User : root <root>
Return-Code : Success
Command Line : install libguestfs
Transaction performed with:
Installed rpm-4.11.3-21.el7.x86_64 @anaconda
Installed yum-3.4.3-150.el7.centos.noarch @anaconda
Installed yum-plugin-fastestmirror-1.1.31-40.el7.noarch @anaconda
Packages Altered:
Dep-Install attr-2.4.46-12.el7.x86_64 @base
Dep-Install iscsi-initiator-utils-6.2.0.873-35.el7.i686 @base
...
使用 yum deplist libguestfs 确认确实是这样。
确认具体哪个 package 直接依赖iscsi-initiator-utils
yum deplist 只能查看扁平依赖,无法查看依赖树。
repoquery --tree-requires <package-name> 则可以查看包的直接依赖。
因 libguestfs 的依赖树太大,这里以 bash 的依赖树举例。
# repoquery --tree-requires bash
bash-4.1.2-15.el6_4.x86_64 [cmd line]
\_ glibc-2.12-1.132.el6_5.4.i686 [1: rtld(GNU_HASH)]
| \_ basesystem-10.0-4.el6.noarch [1: basesystem]
| | \_ filesystem-2.4.30-3.el6.x86_64 [1: filesystem]
| | | \_ setup-2.8.14-20.el6_4.1.noarch [1: setup >= 2.5.4-1]
| | \_ setup-2.8.14-20.el6_4.1.noarch [1: setup]
| \_ glibc-common-2.12-1.132.el6_5.4.x86_64 [1: glibc-common = 2.12-1.132.el6_5.4]
| | \_ bash-4.1.2-15.el6_4.x86_64 [2: /bin/bash, /bin/sh]
| | | \_ glibc-2.12-1.132.el6_5.4.i686 [1: rtld(GNU_HASH)]
| | | \_ glibc-2.12-1.132.el6_5.4.x86_64 [4: libc.so.6(GLIBC_2.4)(64bit), libdl.so.2()(64bit), libdl.so.2(GLIBC_2.2.5)(64bit), rtld(GNU_HASH)]
| | | \_ ncurses-libs-5.7-3.20090208.el6.i686 [1: ncurses-libs]
| | | \_ ncurses-libs-5.7-3.20090208.el6.x86_64 [2: libtinfo.so.5()(64bit), ncurses-libs]
| | \_ glibc-2.12-1.132.el6_5.4.i686 [1: glibc = 2.12-1.132.el6_5.4]