Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use RPM

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to use RPM, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to use RPM. Let's take a look at it.

RPM Package Manager (RPM) is a powerful command-line-driven package management tool for installing, uninstalling, verifying, querying, and updating software packages on Linux systems.

1. How to initialize the database using rpm?

Using the rpm command to query whether a rpm package is installed is also done through the rpm database; so we often initialize the rpm database with the following two commands

[root@feiyu] # rpm-- initdb [root@feiyu ~] # rpm-- rebuilddb Note: this will take a long time

Note: these two parameters are extremely useful, sometimes there is something wrong with the rpm system and cannot be installed and queried, mostly here.

2. Query the installed software of the system? [root@feiyu ~] # rpm-qa | more3 to query which software package an installed file belongs to.

Syntax: rpm-qf software name

[root@feiyu ~] # rpm-qf `which Nmon-14i-8.el6.x86_644 to query where the installed software packages are installed?

Syntax: rpm-ql software name

[root@feiyu ~] # rpm-ql nmon/usr/bin/nmon/usr/share/doc/nmon-14i/usr/share/doc/nmon-14i/Documentation.txt/usr/share/man/man1/nmon.1.gz5, how to query the information of an installed software package?

Syntax format: rpm-qi software name

[root@feiyu ~] # rpm-qi nmon6, check the configuration file of the installed software

Syntax format: rpm-qc software name

[root@feiyu ~] # rpm-qc vsftpd/etc/logrotate.d/vsftpd/etc/pam.d/vsftpd/etc/vsftpd/ftpusers/etc/vsftpd/user_list/etc/vsftpd/vsftpd.conf7, check the installation location of a document where the software has been installed:

Syntax format: rpm-qd software name

[root@feiyu ~] # rpm-qd nmon/usr/share/doc/nmon-14i/Documentation.txt/usr/share/man/man1/nmon.1.gz8, check the software packages and files that the installed software depends on

Syntax format: rpm-qR software name

[root@feiyu ~] # rpm-qR nmon

Query the summary of installed software: for a package that has been installed, we can combine a series of parameters, such as rpm-qil; for example,

[root@feiyu ~] # rpm-qil nmon9, view uninstalled packages:

View the purpose, version, and other information of a software package

Syntax: rpm-qpi file.rpm

[root@feiyu ~] # rpm-qpi glibc-2.15-60.el6.x86_64.rpm10, view the files contained in a software package

Syntax: rpm-qpl file.rpm

[root@feiyu] # rpm-qpl glibc-2.15-60.el6.x86_64.rpm

11, check the location of the documentation for the package

Syntax: rpm-qpd file.rpm

[root@feiyu ~] # rpm-qpd glibc-2.15-60.el6.x86_64.rpm12, view the configuration file of a software package

Syntax: rpm-qpc file.rpm

[root@feiyu ~] # rpm-qpc glibc-2.15-60.el6.x86_64.rpm13 to view the dependencies of a software package this is the most useful command syntax for uninstalled rpm: rpm-qpR file.rpm [root@feiyu ~] # rpm-qpR glibc-2.15-60.el6.x86_64.rpm14, how to install the src.rpm package:

First: compile to rpm package.

1, [root@feiyu ~] # rpm-I vsftpd-2.2.2-11.el6_3.1.src.rpm2, [root@feiyu ~] # cd rpmbuild/SPECS/ [root@feiyu SPECS] # ls-l total 24-rw-r--r--. 1 root root 21472 Feb 13 2013 vsftpd.spec3, [root@feiyu SPECS] # rpmbuild-bb vsftpd.spec

At this point, in.. / RPMS/ (depending on the package) in this directory, there is a new rpm package, which is the compiled binary. Execute: rpm-I new-package.rpm can be installed.

The second kind: compile to source code package

1. [root@feiyu] # rpm-I vsftpd-2.2.2-11.el6_3.1.src.rpm2. [root@feiyu] # cd rpmbuild/SPECS/3. [root@feiyu SPECS] # rpmbuild-bp vsftpd.spec4. [root@feiyu SPECS] # cd.. / BUILD/vsftpd-2.2.2/5. [root@feiyu vsftpd-2.2.2] # / configure this step is the same as compiling ordinary source software, you can add the parameter 6. [root@feiyu vsftpd-2.2.2] # make7. [root@feiyu vsftpd-2.2.2] # make install

Attached: common parameters of RPM command

-- initdb: initialize the database-- rebuilddb: rebuild the reverse list of the database from the header information of the installed package-Q: query the software in the system or query the contents of the specified rpm package-I: install the software in the system-U: upgrade the software in the system-e: uninstall the software in the system-h: display the rpm installation process with the # (hash) symbol-v: describe the installation process in detail-c: list All configuration files-d: list all documentation files-l: list all files in the package-ivh: installation shows installation progress-- install--verbose--hash-Uvh: upgrade package-Update -qf: find out which RPM package the specified file belongs to [Query File];-p: indicate that the RPM package is queried, which is usually used at the same time with other parameters, such as:-qlp: query the list of all files in a RPM package-qip: query the content information of a RPM package. This is the end of the article on "how to use RPM". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use RPM". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report