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

Introduction to the usage of RPM in CentOS system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "introduction to the usage of RPM in CentOS system". In daily operation, I believe many people have doubts about the introduction of the usage of RPM in CentOS system. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "introduction to the usage of RPM in CentOS system"! Next, please follow the editor to study!

RPM is the abbreviation of Red Hat Package Manager, which originally means Red Hat package management, as the name implies, it is the package management contributed by Red Hat; it is used in mainstream distributions such as Fedora, Redhat, Mandriva, SuSE, YellowDog and other mainstream distributions, as well as the secondary development of these versions; what is included in the RPM package? It contains executable binary programs, which are similar to the .exe files in Windows's software package; the RPM package also contains files needed to run the program, which is similar to Windows's software package. Windows programs run, in addition to .exe files, there are other files. An application in a RPM package, sometimes in addition to its own additional files to ensure its normal, but also need other specific version of the file, this is the package dependency; dependency is not unique to Linux, Windows operating system is also the same; for example, when we run 3D games in the Windows system, he may be prompted to install Direct 9; Linux and Windows principles are similar.

I. the purpose of RPM package management

1. You can install, remove, upgrade and manage software; of course, you can also install and upgrade software online

2. Through RPM package management, you can know which files the package contains, and you can also know which package a file in the system belongs to.

3. You can query whether the software package in the system is installed and its version

4. As a developer, you can package and release your program as a RPM package.

5. Import, verification and signing of software package signatures GPG and MD5

6. Check for dependencies to see if any software packages disrupt the system due to incompatibility

II. The right to use RPM

The installation, deletion and update of RPM software can only be used with the permission of root; any user can operate the query function; if the ordinary user has the permission to install the directory, he can also install it.

III. A simple use of rpm

In addition to the package manager, we can also install it through the rpm command; can all packages be installed through the rpm command? No, the file ends with the. rpm suffix; sometimes we find file.rpm on some websites and use rpm to install it

I) initialize the rpm database

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

The code is as follows:

[root@localhost beinan] # rpm-- initdb

[root@localhost beinan] # 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.

2) query function managed by RPM software package:

Command format

The code is as follows:

Rpm {- Q |-- query} [select-options] [query-options]

The query function of RPM is extremely powerful and is one of the most important functions; to give a few commonly used examples, for more detailed details, please refer to # man rpm

1. Query the installed software in the system

1) query the installed software of the system

Syntax: rpm-Q software name

For example:

The code is as follows:

[root@localhost beinan] # rpm-Q gaim

Gaim-1.3.0-1.fc4

-Q is-- query, which means "ask" in Chinese. This command indicates whether gaim is installed on the system; if it is installed, it will output information; if it is not installed, it will output information that gaim is not installed; to view all installed packages in the system, add the-a parameter

The code is as follows:

[root@localhost RPMS] # rpm-qa

If you view it in pages, add a pipe | and more command

The code is as follows:

[root@localhost RPMS] # rpm-qa | more

Look for some software in all installed packages, such as gaim; you can extract it with grep

The code is as follows:

[root@localhost RPMS] # rpm-qa | grep gaim

The function of the above is the same as the output of rpm-Q gaim; 2) query which package an installed file belongs to

Syntax rpm-qf file name

Note: the absolute path where the file name is located should be indicated, for example:

The code is as follows:

[root@localhost RPMS] # rpm-qf / usr/lib/libacl.la

Libacl-devel-2.2.23-8

3) query where the installed software packages are installed

Syntax: rpm-ql software name or rpm rpmquery-ql software name

For example:

The code is as follows:

[root@localhost RPMS] # rpm-ql lynx

[root@localhost RPMS] # rpmquery-ql lynx

4) query the information of an installed software package

Syntax format: rpm-qi software name

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qi lynx

5) check the configuration file of the installed software

Syntax format: rpm-qc software name

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qc lynx

6) check the installation location of a document where the software has been installed:

Syntax format: rpm-qd software name

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qd lynx

7) check the software packages and files that the installed software depends on

Syntax format: rpm-qR software name

For example:

The code is as follows:

[root@localhost beinan] # rpm- qR rpm-python

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:

The code is as follows:

[root@localhost RPMS] # rpm-qil lynx

2. View the uninstalled software packages:

The prerequisite for viewing is that you have a .rpm file, that is, a view of the existing software file.rpm, etc.; 1) to view the purpose, version and other information of a software package

Syntax: rpm-qpi file.rpm

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qpi lynx-2.8.5-23.i386.rpm

2) View the files contained in a software package

Syntax: rpm-qpl file.rpm

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qpl lynx-2.8.5-23.i386.rpm

3) check the location of the documentation for the package

Syntax: rpm-qpd file.rpm

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qpd lynx-2.8.5-23.i386.rpm

5) View the configuration file of a software package

Syntax: rpm-qpc file.rpm

For example:

The code is as follows:

[root@localhost RPMS] # rpm-qpc lynx-2.8.5-23.i386.rpm

4) View the dependencies of a software package

Syntax: rpm-qpR file.rpm

For example:

The code is as follows:

[root@localhost archives] # rpm-qpR yumex_0.42-3.0.fc4_noarch.rpm

/ bin/bash

/ usr/bin/python

Config (yumex) = 0.42-3.0.fc4

Pygtk2

Pygtk2-libglade

Rpmlib (CompressedFileNames)

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