Linux-rpm command - to view the information package has been installed and not installed rpm package information

RPM abbreviations commonly used commands in a variety of options, there is a basis in fact, and then figure out, actually a lot of fun, we can refer to the below:
q = Query
the p-Package Penalty for =
i = info
L = List
f = File
c = conf
...

one: Check the system has been installed software related commands

1, query system installed rpm package
# Rpm--qa 

: example
grep ZYPP | / etc / ZYPP # rpm -qa: the NTP-Slave
zypper-log-1.6.307-0.7.12
1.6.307-0.7.12-zypper
libzypp-9.34.0-0.7.15

2, query system in a known files belong to which rpm package
# rpm -qf / absolute path / file_name

example:
the NTP-Slave: / etc / # RPM -qf /etc/zypp/zypp.conf ZYPP 
libzypp-9.34.0-0.7.15

3, the installation path query installed package of related files
# rpm -ql software name

example:
the NTP-Slave: / etc / ZYPP # RPM -ql libzypp-9.34.0-0.7.15
/etc/logrotate.d/zypp-history.lr
/ etc / ZYPP
/etc/zypp/repos.d
/etc/zypp/services.d
/ etc / ZYPP / systemCheck
/etc/zypp/zypp.conf
/ usr / bin / Package-Manager
/ usr / bin / SU-Package-Manager
.. omitting ...

4, a query information package has been installed
#rpm -qi software name

example:
the NTP-Slave: / etc / ZYPP # RPM -qi libzypp-9.34.0-0.7.15
the name: libzypp Relocations: ( relocatable not)
Version: 9.34.0 Vendor: SUSE LINUX Products's GmbH, Nuernberg, Germany
Release: 0.7.15 Build a Date: Wed May 29 23:20:00 2013
the Install a Date: Mon Dec 19 20:00:23 2016 Build Host: crick2
... omitted ...
the NTP-Slave: / etc / ZYPP # RPM -qc libzypp-9.34.0-0.7.15
/etc/logrotate.d/zypp-history.lr
/ etc / ZYPP / systemCheck
/etc/zypp/zypp.conf

5, view installed software configuration files
#rpm -qc Software name

example:
the NTP-Slave: / etc / ZYPP # RPM -qc libzypp-9.34.0-0.7 .15
/etc/logrotate.d/zypp-history.lr
/ etc / ZYPP / systemCheck
/etc/zypp/zypp.conf

6, view the installation location of the document installed software
#rpm -qd software name

example:
the NTP-Slave : / etc / ZYPP # RPM -qd libzypp-9.34.0-0.7.15
/usr/share/man/man5/locks.5.gz

7, view the software packages and dependent files are installed
#rpm -qR software name

example:
the NTP-Slave: / etc / RPM -qR gcc43-4.3.4_20091019-0.37.30 ZYPP #
binutils  
the glibc-devel  
cpp43 = 4.3.4_20091019-0.37.30
libgcc1> = 4.3.4_20091019-0.37.30
libgomp1> = 4.3.4_20091019-0.37.30
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.11)(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3)(64bit)  
libc.so.6(GLIBC_2.7)(64bit)  
rpmlib(PayloadIsLzma) <= 4.4.6-1

Two: Check the system is not relevant command to install the software

first this did not exist rpm package installed, we can view information

1. For more information see the package
#rpm -qpi rpm package

example:
suse11sp3-1: ~ # rpm-qpi rzsz- 0.12.20-934.22.x86_64.rpm 
the Name: rzsz Relocations: (not relocatable)
Version: 0.12.20 Vendor: SUSE LINUX Products's GmbH, Nuernberg, Germany
Release: 934.22 Build a Date: Sat Feb 21 09:28:18 2009
the Install a Date : (Not Installed) the Build the Host: Brubeck
Group: Hardware / Modem the Source the RPM: rzsz-0.12.20-934.22.src.rpm
Size: 249 242 License: the GPL V2 or later
the Signature: the RSA /. 8, 09:28 Sat On Feb 21 is: 23 2009, Key ID e3a5c360307e3d54
Packager    : http://bugs.opensuse.org
URL         : http://www.ohse.de/uwe/software/lrzsz.html
Summary     : X-, Y-, and Z-Modem Data Transfer Protocols
Description :
rzsz allows you to use "sz filename" to send a file to your local
system.
Distribution: SUSE Linux Enterprise 11

2、查看软件包所包含的目录和文件
#rpm -qpl rpm包

示例:
suse11sp3-1:~ # rpm -qpl rzsz-0.12.20-934.22.x86_64.rpm 
/usr/bin/rb
/usr/bin/rx
/usr/bin/rz
/usr/bin/sb
/usr/bin/sx
/usr/bin/sz
/usr/share/doc/packages/rzsz
/usr/share/doc/packages/rzsz/ABOUT-NLS
/usr/share/doc/packages/rzsz/AUTHORS
/usr/share/doc/packages/rzsz/COMPATABILITY
/ usr / report this content share / DOC / Packages Standard Package / rzsz / COPYING
/ usr / report this content share / DOC / Packages Standard Package / rzsz / ChangeLog
/ usr / report this content share / DOC / Packages Standard Package / rzsz / NEWS
/usr/share/doc/packages/rzsz/README.cvs
/usr/share/doc/packages/rzsz/README.gettext
/usr/share/doc/packages/rzsz/README.isdn4linux
/usr/share/doc/packages/rzsz/README.tests
/ usr / report this content share / DOC / Packages Standard Package / rzsz / THANKS
/ usr / report this content share / DOC / Packages Standard Package / rzsz / TODO
/usr/share/locale/de/LC_MESSAGES/lrzsz.mo
/usr/share/man/man1/rz.1.gz
/ usr / report this content share / man /man1/sz.1.gz

3, the position of the package of documents to see where
#rpm -qpd rpm package

example:
suse11sp3-1: ~ # RPM -qpd rzsz-0.12.20-934.22.x86_64.rpm 
/ usr / report this content share / DOC / Packages / rzsz / ABOUT the NLS-
/ usr / Share / DOC / Packages / rzsz / the AUTHORS
/ usr / report this content share / DOC / Packages Standard Package / rzsz / Compatability
/ usr / report this content share / DOC / Packages Standard Package / rzsz / COPYING
/ usr / report this content share / DOC / Packages Standard Package / rzsz / ChangeLog
/ usr / report this content share / DOC / Packages Standard Package / rzsz / NEWS
/ usr /share/doc/packages/rzsz/README.cvs
/usr/share/doc/packages/rzsz/README.gettext
/usr/share/doc/packages/rzsz/README.isdn4linux
/ usr / report this content share / DOC / Packages Standard Package / rzsz /README.tests
/ usr / Share / DOC / Packages / rzsz / THANKS
/ usr / Share / DOC / Packages / rzsz / the TODO
/usr/share/man/man1/rz.1.gz
/ usr / Share / man / man1 /sz.1.gz

. 4, see the package profile (if not, then the standard output is empty)
#rpm RPM package -qpc

example:
suse11sp3-1: ~ # -qpc rzsz-0.12.20-934.22 RPM. x86_64.rpm

5, see the package dependencies
#rpm -qpR rpm package

example:
suse11sp3-1:~ # rpm -qpR rzsz-0.12.20-934.22.x86_64.rpm
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libc.so.6(GLIBC_2.7)(64bit)  
libc.so.6(GLIBC_2.8)(64bit)  
libnsl.so.1()(64bit)  
rpmlib(PayloadIsLzma) <= 4.4.2-1

 

Guess you like

Origin www.cnblogs.com/ls1519/p/12659116.html
Recommended