2018年2月4日日曜日

dpkg/apt/rpm/yumでインストールしたパッケージについて、パッケージの情報やファイルのインストール場所等を確認する

パッケージをインストールしたは良いけど、
どこに何が展開されたか?を確認したいとき用。

以下コマンドで確認できる。

RedHat系の場合

rpm -lqi <パッケージ名>

Debian系の場合

dpkg -s <パッケージ名>
dpkg -L <パッケージ名>

以下、具体例。

  • rpm -lqi <パッケージ名>
$ sudo rpm -lqi openldap-clients
Name        : openldap-clients
Version     : 2.4.44
Release     : 5.el7
Architecture: x86_64
Install Date: Fri 04 Sun 2018 10:00:00 AM JST
Group       : Applications/Internet
Size        : 583815
License     : OpenLDAP
Signature   : RSA/SHA256, Fri 11 Aug 2017 03:38:04 AM JST, Key ID 24c6a8a7f4a80eb5
Source RPM  : openldap-2.4.44-5.el7.src.rpm
Build Date  : Fri 04 Aug 2017 11:24:19 PM JST
Build Host  : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://www.openldap.org/
Summary     : LDAP client utilities
Description :
OpenLDAP is an open-source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools. LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet. The openldap-clients package contains the client
programs needed for accessing and modifying OpenLDAP directories.
/usr/bin/ldapadd
/usr/bin/ldapcompare
/usr/bin/ldapdelete
/usr/bin/ldapexop
/usr/bin/ldapmodify
/usr/bin/ldapmodrdn
/usr/bin/ldappasswd
/usr/bin/ldapsearch
/usr/bin/ldapurl
/usr/bin/ldapwhoami
/usr/share/man/man1/ldapadd.1.gz
/usr/share/man/man1/ldapcompare.1.gz
/usr/share/man/man1/ldapdelete.1.gz
/usr/share/man/man1/ldapexop.1.gz
/usr/share/man/man1/ldapmodify.1.gz
/usr/share/man/man1/ldapmodrdn.1.gz
/usr/share/man/man1/ldappasswd.1.gz
/usr/share/man/man1/ldapsearch.1.gz
/usr/share/man/man1/ldapurl.1.gz
/usr/share/man/man1/ldapwhoami.1.gz
  • dpkg -s <パッケージ名>; dpkg -L <パッケージ名>
$ sudo dpkg -s ldap-utils
Package: ldap-utils
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 675
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: openldap
Version: 2.4.42+dfsg-2ubuntu3.2
Replaces: openldap-utils, openldapd, slapd (<< 2.2.23-0.pre6)
Provides: ldap-client, openldap-utils
Depends: libc6 (>= 2.14), libldap-2.4-2 (= 2.4.42+dfsg-2ubuntu3.2), libsasl2-2
Recommends: libsasl2-modules
Suggests: libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal
Conflicts: ldap-client, openldap-utils, umich-ldap-utils
Description: OpenLDAP utilities
 This package provides utilities from the OpenLDAP (Lightweight
 Directory Access Protocol) package. These utilities can access a
 local or remote LDAP server and contain all the client programs
 required to access LDAP servers.
Homepage: http://www.openldap.org/
Original-Maintainer: Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>

$ dpkg -L ldap-utils
/.
/usr
/usr/bin
/usr/bin/ldapmodify
/usr/bin/ldapexop
/usr/bin/ldapurl
/usr/bin/ldapsearch
/usr/bin/ldapwhoami
/usr/bin/ldapcompare
/usr/bin/ldappasswd
/usr/bin/ldapmodrdn
/usr/bin/ldapdelete
/usr/share
/usr/share/man
/usr/share/man/man5
/usr/share/man/man5/ldif.5.gz
/usr/share/man/man1
/usr/share/man/man1/ldapmodify.1.gz
/usr/share/man/man1/ldappasswd.1.gz
/usr/share/man/man1/ldapmodrdn.1.gz
/usr/share/man/man1/ldapsearch.1.gz
/usr/share/man/man1/ldapcompare.1.gz
/usr/share/man/man1/ldapdelete.1.gz
/usr/share/man/man1/ldapadd.1.gz
/usr/share/man/man1/ldapwhoami.1.gz
/usr/share/man/man1/ldapurl.1.gz
/usr/share/man/man1/ldapexop.1.gz
/usr/share/doc
/usr/share/doc/ldap-utils
/usr/share/doc/ldap-utils/README.Debian
/usr/share/doc/ldap-utils/copyright
/usr/bin/ldapadd
/usr/share/doc/ldap-utils/changelog.Debian.gz