Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the rpm command

Shulou Source: shulou.com Published: 2022-06-01 02:57:10 11月02日 Update

This article mainly shows you "how to use rpm command", the content is simple and easy to understand, clear organization, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to use rpm command" this article bar.

rpm (Red Hat Package Manger) refers to packaging and installation tools

rpm -a

rpm -q

< rpm package name>

Interpretation: Query whether a package is installed

rpm -qa

rpm -qa -q Query all packages (all) using query mode (query)-a

List all installed rpm packages

The difference from rpm -a is already, for example:

rpm -qa | grep

rpm -qa | grep xxx |pipeline technology, delete grep lookup---a text search tool

Interpretation: Find xxx in the information returned by-qa and return the final result.

rpm -qa |grep -i xxx-i case insensitive xxx

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

rpm -e --"unloading" requiring caution

Normally, we'd use

rpm -e xxx

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

is returned

error: xxx is needed by yyy

At this time, you can force deletion without checking dependencies (careful operation)

rpm -e --nodeps

Alternatively, if several packages have the same name, ignore dependencies and delete all packages with the same name using the following command

rpm -e --allmatches --nodeps

Of course, delete and query can be combined, for example

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

the 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 unknown. I don't know why it is automatically saved as.repo.rpmsave. The solution is to change it to the original.repo format by mv command.

The above is "rpm command how to use" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Commands queries content tools articles questions learning help search combination same information reason name size kit that is situation meaning technology Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MariaDB Docker Linux Redmi