安装前查询包中的依赖和脚本 | CentOS 9

安装前查询包中的依赖和脚本 | CentOS 9

如果我想在安装 RPM 软件包之前对其进行搜索,该怎么做?

如果我运行 yum info bind,它会给出基本概述:

[user@localhost ~]$ yum info bind
Last metadata expiration check: 0:16:53 ago on Tue 06 Sep 2022 06:07:52 PM CDT.
Available Packages
Name         : bind
Epoch        : 32
Version      : 9.16.23
Release      : 4.el9
Architecture : x86_64
Size         : 504 k
Source       : bind-9.16.23-4.el9.src.rpm
Repository   : appstream
Summary      : The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server
URL          : https://www.isc.org/downloads/bind/
License      : MPLv2.0
Description  : BIND (Berkeley Internet Name Domain) is an implementation of the DNS
             : (Domain Name System) protocols. BIND includes a DNS server (named),
             : which resolves host names to IP addresses; a resolver library
             : (routines for applications to use when interfacing with DNS); and
             : tools for verifying that the DNS server is operating properly.

我们可以使用 yum install bind 查看将安装哪些依赖项:

[user@localhost ~]$ sudo yum install bind
Last metadata expiration check: 0:07:38 ago on Tue 06 Sep 2022 06:18:56 PM CDT.
Dependencies resolved.
==========================================================================================================================================================================================================================================================================================
 Package                                                                  Architecture                                                  Version                                                                    Repository                                                        Size
==========================================================================================================================================================================================================================================================================================
Installing:
 bind                                                                     x86_64                                                        32:9.16.23-4.el9                                                           appstream                                                        504 k
Installing dependencies:
 bind-dnssec-doc                                                          noarch                                                        32:9.16.23-4.el9                                                           appstream                                                         47 k
 python3-bind                                                             noarch                                                        32:9.16.23-4.el9                                                           appstream                                                         69 k
Installing weak dependencies:
 bind-dnssec-utils                                                        x86_64                                                        32:9.16.23-4.el9                                                           appstream                                                        118 k

Transaction Summary
==========================================================================================================================================================================================================================================================================================
Install  4 Packages

但是,有没有办法查询将通过 rpm 安装哪些依赖项和脚本?示例: rpm -q --scripts bind.x86_64 或 rpm -ql bind.x86_64

[user@localhost ~]$ rpm -ql bind.x86_64
package bind.x86_64 is not installed

答案1

人们可以用来yumdownloader戳一下包裹:

# yum -y install yum-utils
# yumdownloader bind
# rpm -qp --scripts bind*.rpm

为了避免安装yum-utils,另一个选择可能是:

# yum --downloadonly install bind
# find /var/cache/yum -name bind\*

如果您还需要检查这些依赖项,那么这样做的优点是可以降低依赖项。

相关内容