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 tools to manage software in Linux

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Introduction to RPM 1. The meaning of RPM

The full name of RPM is: Red Hat Package Manager, which is the RPM package manager. In the Linux system, the corresponding command is rpm. We see that the name contains Red Hat, which means it is mainly used in the Red Hat distribution, in addition to CentOS, which is closest to Red Hat, and some other mainstream distributions: SuSE, Fedora, and so on.

2. RPM features rpm is also a packaging format, using rpm tools to manage rpm packages are files that have been pre-compiled and packaged, and it is more convenient to install and have rpm-related databases to record the dependencies between software. if there are no related dependencies, they cannot be installed or run normally. If you look for dependencies one by one, there may be dependencies in the search process. It will turn into a nightmare that you can use yum tools to solve rpm dependency problems, which will be introduced in the following article. Package name

Vim: software name part enhanced: software component part 7: major version number 4: minor version number 629: revision number 5: release times el6_10.2: platform name, indicating which release version x86room64: system digits, i386 and so on are applicable to 32 bits, x86room64 means applicable to 64 bits, noarch represents general 2, common commands 1. Query

When querying the software, the applicable rpm tool can only query the software information installed in the form of rpm software package, while the software that decompresses and compiles and installs can not query the information.

Abbreviation for q:query

(1) query the information of installed software

Rpm-Q exact software name: query an installed software

Rpm-qa: displays a list of all installed software

Rpm-qi exact software name: query the details of the specified installation software

Rpm-ql exact software name: view the directory and file list of the specified software package on the system

Rpm-qf directory or folder: view the package corresponding to the currently specified file or directory

Pipe and filtering functions can be used when the specific name is uncertain: rpm-qa | grep vim

Statistics on the total number of installed software packages: rpm-qa | wc-l

(2) query the information of uninstalled software

The main purpose of this operation is to query the details before the package is installed, so the parameter passed in is the path of an existing package.

Full path of rpm-qpi package: query the details of the software to be installed

Full path of rpm-qpl package: query the installation path of the software to be installed

two。 Verification

Use-V to verify the correctness of the software package.

Abbreviation for V:verify

(1) Common commands

Rpm-V exact software name: message only appears when verification fails rpm-Va: scan and verify all software packages (root users are recommended, there will be no permission problems), list items that have changed, poor dependencies, missing key configuration files, etc.

(2) Information identification

The second half of the check information shows the corresponding directory or file, and the first half uses uppercase letters to indicate the changed items.

S: size change M: permission change 5:MD5 change L: link change D: device change U: owner change G: array change T: modification time change 3. Unloading

The uninstall of the package needs to be performed by the root user, and the name of the uninstall package must be fully provided, which can be obtained first through a filter query.

Abbreviation for e:erase (erasure)

Other software may depend on this software when uninstalling, and may make other software unavailable after uninstallation. if there is a dependency, dependency information will be displayed. if you insist on removing it, you can use the option to ignore dependencies:-- nodeps.

Rpm-e [--nodeps] exact software name: uninstall an installed software, ignoring the dependency as optional rpm-e-- nodeps vim-enhanced4. Installation

The installation of the software package needs to be performed by root users. Before installation, you will usually query the installed software and uninstall the software that conflicts with it.

Abbreviation for i:install

During software installation, there may be a lack of a dependency in the system, which can not be installed properly. You can use the-- force option to force the installation, but there is no guarantee that it will be used normally after installation. The general solution is to install the required dependent package before installing the software, or use the yum tool.

Rpm-I [--force] package full path: install a software and force it to be optional

Rpm-ivh package full path: common commands, install a software, display details and progress (represented by #)

5. Upgrade

Similar to installation, use root user actions to upgrade a piece of software.

Shorthand for U:update. Abbreviation for F:freshen.

Since the old version of the software may or may not have been installed at the time of the upgrade, two parameters are provided.

U means: if the corresponding software package is not installed, it will be installed directly, and the effect is the same as that of I

F: if the corresponding package is not originally installed, the installation will be abandoned

Complete path of rpm-UBG F package: upgrade a software 6. Maintain

(1) RPM database maintenance

If the native RPM database is corrupted, it may cause dependencies to be read incorrectly and rpm-related functions cannot be performed properly, and the-- initdb option can be used at this point.

Rpm-initdb

(2) signature verification

After downloading a software, if we are not sure where it came from and whether it has been tampered with, we need to use the corresponding GPG file. Generally, the file can be found in CD images and network images. If you import it with the-- import command, it will take effect automatically when you install the software.

Rpm-import / mnt/cdrom/RPM-GPG-KEY-CentOS-6

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

Servers

Wechat

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

12
Report