Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use RPM in Linux

Shulou Source: shulou.com Published: 2022-06-01 14:23:07 11月17日 Update

This article mainly introduces how to use RPM in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The rpm command is an administrative tool for RPM software packages. Rpm, originally a Red Hat Linux distribution program designed to manage Linux suites, is popular because it follows GPL rules and is powerful and convenient.

Rpm-a

Rpm-Q

Interpretation: query whether a package is installed

Rpm-qa

Rpm-qa-Q uses query mode (query)-a to query all suites (all)

Interpretation: list all rpm package that have been installed

The difference with rpm-an is that it has been, for example:

Rpm command explanation rpm command explanation

Rpm-qa | grep

Rpm-qa | grep xxx | Pipeline technology. Delete means grep search-A text search tool

Interpretation: look up the xxx in the information returned by-qa and return it as the final result

Rpm-qa | grep-I xxx-i is not case sensitive to xxx

Of course, as a search tool, grep can also be combined with other commands

Rpm-e-requires careful "uninstall"

Normally, when uninstalling, we use the

Rpm-e xxx

But if the software yyy is "dependent" on xxx-that is, yyy must have xxx to run

Will return

Error: xxx is needed by yyy

At this point, you can force the deletion of ↓ without checking for dependencies (proceed with caution)

Rpm-e-nodeps

In addition, if you query that there are several packages with the same name, you can ignore the dependency and delete all packages with the same name using the following command

Rpm-e-- allmatches-- nodeps

Of course, deletions and queries can be combined, such as

Rpm-e-nodeps' rpm-qa | grep mysql'

Problems that may be encountered

Warning: / etc/yum.repos.d/mysql-community.repo saved as / etc/yum.repos.d/mysql-community.repo.rpmsave

The cause of the problem is temporarily unknown. I don't know why it is automatically saved as .repo.rpmsave. The solution is to change it to the original .repo format with the mv command.

Thank you for reading this article carefully. I hope the article "how to use RPM in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Commands articles queries tools suites software questions search management combination power same value information interest function power reason original at the same time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn OPPO Reno Shulou Tech Info Huawei