linux-rpm command-View installed package information and non-installed RPM package information

Source: Internet
Author: User
Tags gettext

The "preface" is explained in the blog post:

This article describes the rpm command in a personal tone, including viewing installed package information and not installing RPM package information.

At the current point in time "June 12, 2017 " under the limited level of skills, there may be a lot of knowledge understanding is not enough in-depth or comprehensive, I hope you point out the issue of common communication, in the follow-up work and learning, such as found in the content and the actual situation deviation, will improve the content of this blog post.



Body:


RPM common commands in the various abbreviation options, in fact, there is a basis, to understand, in fact, very fun, we can refer to below:
Q=query
P=package
I=info
L=list
F=file
C=conf
...

One: View system-installed software-related commands

1, check the system has installed RPM package
#rpm-qa

Example:
NTP-SLAVE:/ETC/ZYPP # Rpm-qa | grep zypp
zypper-log-1.6.307-0.7.12
zypper-1.6.307-0.7.12
libzypp-9.34.0-0.7.15

2, the query system of a known file belongs to which RPM package
# RPM-QF/absolute path/file_name

Example:
NTP-SLAVE:/ETC/ZYPP # rpm-qf/etc/zypp/zypp.conf
libzypp-9.34.0-0.7.15

3. Query the installation path of the associated files for installed packages
# RPM-QL Software name

Example:
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/package-manager-su
... Omitted...

4. Query the information of an installed package
#rpm-qi software name

Example:
NTP-SLAVE:/ETC/ZYPP # Rpm-qi libzypp-9.34.0-0.7.15
NAME:LIBZYPP Relocations: (not relocatable)
version:9.34.0 vendor:suse LINUX Products GmbH, Nuernberg, Germany
release:0.7.15 Build date:wed 29 23:20:00 2013
Install Date:mon Dec 20:00:23 Build Host:crick2
... Omitted...
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 the configuration files for installed software
#rpm-QC software name

Example:
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 installed software documents
#rpm-QD software name

Example:
NTP-SLAVE:/ETC/ZYPP # RPM-QD libzypp-9.34.0-0.7.15
/usr/share/man/man5/locks.5.gz

7. View the packages and files on which the installed software depends
#rpm-QR software name

Example:
NTP-SLAVE:/ETC/ZYPP # RPM-QR gcc43-4.3.4_20091019-0.37.30
Binutils
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

Second: Check that the system does not have software-related commands

First of all, this non-installed RPM package exists, we can view the relevant information

1. View Package Details
#rpm-qpi RPM Package

Example:
suse11sp3-1:~ # Rpm-qpi rzsz-0.12.20-934.22.x86_64.rpm
Name:rzsz Relocations: (not relocatable)
version:0.12.20 vendor:suse LINUX Products GmbH, Nuernberg, Germany
release:934.22 Build Date:sat Feb 21 09:28:18 2009
Install Date: (not installed) Build Host:brubeck
Group:hardware/modem Source rpm:rzsz-0.12.20-934.22.src.rpm
size:249242 LICENSE:GPL v2 or later
SIGNATURE:RSA/8, Sat 09:28:23, 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 "sz filename" to send a file to your local
System.
Distribution:suse Linux Enterprise 11

2. View the directories and files included in the package
#rpm-QPL RPM Package

Example:
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/share/doc/packages/rzsz/copying
/usr/share/doc/packages/rzsz/changelog
/usr/share/doc/packages/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/share/doc/packages/rzsz/thanks
/usr/share/doc/packages/rzsz/todo
/usr/share/locale/de/lc_messages/lrzsz.mo
/usr/share/man/man1/rz.1.gz
/usr/share/man/man1/sz.1.gz

3. View the location of the package's documentation
#rpm-qpd RPM Package

Example:
suse11sp3-1:~ # RPM-QPD rzsz-0.12.20-934.22.x86_64.rpm
/usr/share/doc/packages/rzsz/about-nls
/usr/share/doc/packages/rzsz/authors
/usr/share/doc/packages/rzsz/compatability
/usr/share/doc/packages/rzsz/copying
/usr/share/doc/packages/rzsz/changelog
/usr/share/doc/packages/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/share/doc/packages/rzsz/thanks
/usr/share/doc/packages/rzsz/todo
/usr/share/man/man1/rz.1.gz
/usr/share/man/man1/sz.1.gz

4, check the package configuration file (if not, the standard output is empty)
#rpm-qpc RPM Package

Example:
suse11sp3-1:~ # RPM-QPC rzsz-0.12.20-934.22.x86_64.rpm

5. View the dependencies of the package
#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



End:



Thank you for reading, I wish you a rewarding day, thank you!


This article is from the "Breeze Month Blog" blog, please be sure to keep this source http://watchmen.blog.51cto.com/6091957/1934660

linux-rpm command-View installed package information and non-installed RPM package information

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.