LoginSignup
34
56

More than 1 year has passed since last update.

rpm の依存関係調査メモ

Last updated at Posted at 2018-01-04

特定 rpm の詳細情報確認(インストール前)

pオプションを付与するとインストール前にrpmファイルから確認可能

パッケージファイル情報の詳細表示。(infomation)
# rpm -qip パッケージファイル名[Enter]

該当パッケージでインストールされるファイル一覧の表示。(list)
# rpm -qlp パッケージファイル名[Enter]

パッケージが依存しているファイルの表示。(require)
# rpm -qRp パッケージファイル名[Enter]

特定 rpm の詳細情報確認

-i(--info)オプションで確認

# rpm -qi openssl-1.0.2k-8.el7.x86_64
Name        : openssl
Epoch       : 1
Version     : 1.0.2k
Release     : 8.el7
Architecture: x86_64
Install Date: 2017年12月28日 01時23分40秒
Group       : System Environment/Libraries
Size        : 833715
License     : OpenSSL
Signature   : RSA/SHA256, 2017年08月11日 03時41分30秒, Key ID 24c6a8a7f4a80eb5
Source RPM  : openssl-1.0.2k-8.el7.src.rpm
Build Date  : 2017年08月04日 15時42分31秒
Build Host  : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://www.openssl.org/
Summary     : Utilities from the general purpose cryptography library with TLS implementation
Description :
The OpenSSL toolkit provides support for secure communications between
machines. OpenSSL includes a certificate management tool and shared
libraries which provide various cryptographic algorithms and
protocols.

インストールされている rpm のリスト表示

-a(--all)オプションで確認

# rpm -qa 
audit-2.7.6-3.el7.x86_64
centos-release-7-4.1708.el7.centos.x86_64
tuned-2.8.0-5.el7.noarch
setup-2.8.71-7.el7.noarch
chrony-3.1-2.el7.centos.x86_64
basesystem-10.0-7.el7.centos.noarch
・
・
・

特定 rpm でインストールされるファイルを表示

-l(--list)オプションで表示可能

# rpm -ql openssl-1.0.2k-8.el7.x86_64
/etc/pki/CA
/etc/pki/CA/certs
/etc/pki/CA/crl
/etc/pki/CA/newcerts
/etc/pki/CA/private
/etc/pki/tls/certs/Makefile
/etc/pki/tls/certs/make-dummy-cert
/etc/pki/tls/certs/renew-dummy-cert
/etc/pki/tls/misc/CA
・
・
・

特定のファイルがどの rpm に含まれているかを確認

-f(--file) オプションで表示可能
下記例だと /usr/lib64/libcrypto.so.10 というファイルは openssl-libs-1.0.2k-8.el7.x86_64 というrpmに含まれていることがわかる

# rpm -qf /usr/lib64/libcrypto.so.10
openssl-libs-1.0.2k-8.el7.x86_64

特定の rpm をインストールするのに必要なパッケージ名称を表示

下記例だと nss をインストールするには bash や glibc が必要であることがわかる

# rpm -q --requires nss | cut -d ' ' -f 1 | xargs rpm -q --whatprovides | sort | uniq

bash-4.2.46-28.el7.x86_64
chkconfig-1.7.4-1.el7.x86_64
glibc-2.17-196.el7_4.2.x86_64
nspr-4.13.1-1.0.el7_3.x86_64
nss-3.28.4-8.el7.x86_64
nss-pem-1.0.3-4.el7.x86_64
nss-softokn-3.28.3-6.el7.x86_64
nss-sysinit-3.28.4-8.el7.x86_64
nss-util-3.28.4-3.el7.x86_64
rpmlib(CompressedFileNames) を提供するパッケージは存在しません。
rpmlib(FileDigests) を提供するパッケージは存在しません。
rpmlib(PayloadFilesHavePrefix) を提供するパッケージは存在しません。
rpmlib(PayloadIsXz) を提供するパッケージは存在しません。
zlib-1.2.7-17.el7.x86_64

特定の rpm が提供するファイルに依存するパッケージを表示

下記例だと nss で提供するファイルは curl が使用していることがわかる

# rpm -q --provides nss | cut -d ' ' -f 1 | xargs rpm -q --whatrequires | sort | uniq
NetworkManager-1.8.0-9.el7.x86_64
NetworkManager-libnm-1.8.0-9.el7.x86_64
NetworkManager-tui-1.8.0-9.el7.x86_64
curl-7.29.0-42.el7.x86_64
libcurl-7.29.0-42.el7.x86_64
・
・
・

rpm インストール・アンインストール時に実行されるスクリプトを表示

--scripts オプションで表示可能

# rpm -q --scripts nss-3.16.1-4.el6_5.x86_64
postinstall scriptlet (using /bin/sh):
# If we upgrade, and the shared filename is a regular file, then we must
# remove it, before we can install the alternatives symbolic link.
if [ $1 -gt 1 ] ; then
・
・
・

実際には実行せず -i や -e した際のチェックを行う(--test)

--test オプションで実行可能

# rpm -i --test postgresql-8.4.20-2.el6_6.i686.rpm
エラー: 依存性の欠如:
    libc.so.6 は postgresql-8.4.20-2.el6_6.i686 に必要とされています
    libc.so.6(GLIBC_2.0) は postgresql-8.4.20-2.el6_6.i686 に必要とされています
    libc.so.6(GLIBC_2.1) は postgresql-8.4.20-2.el6_6.i686 に必要とされています
・
・
・

パッケージの更新履歴を見る

--changelog オプションで実行可能

# rpm -q --changelog libblkid-2.17.2-12.14.el6_5.x86_64
* 水  4月 09 2014 Karel Zak <kzak@redhat.com> 2.17.2-12.14.el6_5
- fix #1085818 - hwclock --systohc can hang on busy or virtual machine
・
・
・
34
56
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
56