Summary of RPM package installation query uninstall command in Linux and detailed explanation of Yum command

Time:2021-10-22

Ubuntu has been used before. Apt get is basically used to install and uninstall the software. Moreover, the software dependencies encountered in the process will be handled automatically for us, which is similar to fool installation. In addition, under the Linux operating system, almost all software can be installed, uninstalled and managed through rpm. The full name of RPM is RedHat package manager, which is proposed by RedHat company to manage software packages under Linux. During Linux Installation, except for several core modules, almost all other modules are installed through rpm. RPM has five operation modes: install, uninstall, upgrade, query and verification.

RPM installation operation

Command:

RPM – I package file name to install

Examples are as follows:

RPM – I example.rpm install the example.rpm package;

RPM – IV example.rpm install the example.rpm package and display the file information being installed during installation;

RPM – IVH example.rpm install the example.rpm package and display the file information being installed and the installation progress during the installation process;

RPM query operation

Command:

rpm -q …

Additional query commands:

A query all installed packages. The following two additional commands are used to query the information of the installation package;

I display the information of the installation package;

L displays the directories where all files in the installation package are installed;

S displays the status of all files in the installation version and the directories to which they are installed; The following two additional commands are used to specify whether to query the installation package or the installed file;

P queries the installation package information;

F query is the information of an installed file;

Examples are as follows:

RPM – QA | grep tomcat4 to check whether tomcat4 is installed;

RPM – QIP example.rpm view the information of the example.rpm installation package;

RPM -qif / bin / DF view the information of the installation package where the / bin / DF file is located;

RPM – QLF / bin / DF check the directory where each file in the installation package where the / bin / DF file is installed;

RPM unload operation

Command:

RPM – E installation package to be uninstalled

Before uninstalling, you usually need to use the RPM – Q… Command to find out the name of the installation package to be uninstalled.

Examples are as follows:

RPM – e tomcat4 uninstall tomcat4 package

RPM upgrade operation

Command:

RPM – U package to be upgraded

Examples are as follows:

RPM – uvh example.rpm upgrade package

RPM verification operation

Command:

RPM – V package to be verified

Examples are as follows:

rpm -Vf /etc/tomcat4/tomcat4.conf

The output information is similar to the following:

S.5….T c /etc/tomcat4/tomcat4.conf

Where, s indicates that the file size has been modified, and t indicates that the file date has been modified. For more verification information, please refer to the RPM help file: man rpm

Additional commands for RPM

–Force forced operations, such as forced installation and deletion;

–Requires displays the dependencies of the package;

–Nodeps ignores dependencies and continues to operate;

The following is the developeppaer editor. Let’s introduce the usage of Yum command in detail. So what is Yum? It is short for yellow dog updater modified. Its purpose is to solve the dependency of RPM package and facilitate users to install, delete and upgrade software.  
If you are a beginner of Linux, you will be troubled by the installation of software. Although the RPM package solves the problem of a certain layer, the dependency of some RPM packages is a headache. The emergence of some RPM package management methods such as Yum and apt makes the installation of software on Linux platform easier. So what is Yum? It is short for yellow dog updater modified. This article will introduce the usage of Yum command in detail. The configuration of Yum warehouse will be described in other technical documents on the 51 open source site.

The usage of the yum command is described in detail below:

Main parameters:

-y      The user is not required to confirm the operation to occur

1. Use Yum to install and delete the software

Yum will query the database for this package. If so, check its dependency conflicts. If not, download and install it; If yes, you will be prompted to ask whether you want to install dependencies at the same time, or delete conflicting packages. You can make your own judgment.
#yum   install   Software name             // Install the specified package with yum
#yum   remove   Software name            // Delete the specified package with yum
#Yum localinstall RPM package file    // Installing local RPM packages using yum
#Yum groupinstall < group name >    // Install all software in the specified group
#Yum groupremove packagegroup < group name > / / delete all software in the specified group
Note: the difference between install and localinstall: when using install, the specified software package will be downloaded and installed from the yum server, while the software specified by localinstall will be installed using the RPM package, and the package required by the dependency will be downloaded and installed on the yum server.

2. Query software information with yum

#yum check-update           // List all updatable software
#yum -y update        // Upgrade all installed software
#Yum -y update < software name >     // Upgrade the specified package
#yum   Upgrade / / a large-scale version upgrade. Unlike Yum update, even old obsolete packages are upgraded
#yum   groupupdate   < Group name > / / updates the packages in the specified software group
#yum info    Software name          // Displays information about the specified package
#yum info updates            // Displays information about all packages that can be updated
#yum info installed           // Displays information about all installed packages
#yum info extras        // Displays information about all software packages that have been installed but are not in the yum repository
#Yum groupinfo < group name > / / displays information about the specified group
#yum list                    // List all installed and installable software
#yum   list   < regex>     // Lists the RPM packages that can be installed or updated and have been installed that match regular expressions in the repository
#yum list   Software name          // Lists the installation of the specified package
#yum   list   available          // Lists all RPM packages that can be installed in the repository
#yum   list   Available < regex > / / list all installable RPM packages matching regular expressions in the resource library
#yum listinstalled           // Lists all installed packages
#yum list   installed <regex>   // Lists all installed RPM packages in the repository that match regular expressions
#yum list extras           // List all installed software packages that are not in the yum warehouse
#Yum list extras < regex > / / list installed RPM packages that match regular expressions but are not included in the resource library
#yum grouplist               // Lists the groups defined by all Yum servers
#Yum search < keyword >       // Finds the specified keyword in the yum source
#yum   search <regex>        // Check the name, description, overview and listed maintainers of all available software to find values that match regular expressions
#yum   list   recent            // Lists the packages that were recently added to the repository
#yum   provides <regex>       // Detect the files contained in the software package and the functions provided by the software, and find the value matching the regular expression
#yum   deplist   < Package >      // Displays dependency information for the package

3. Clear Yum cache

Yum will store the downloaded package and header in the cache without automatically deleting them.
#yum clean packages      // Clear the software package under the cache directory (/ var / cache / Yum)
#yum clean headers       // Clear the headers under the cache directory (/ var / cache / Yum)
#yum clean oldheaders    // Clear the old headers under the cache directory (/ var / cache / Yum)
#yum clean all      // Clear the software package and old headers under the cache directory (/ var / cache / Yum)
#yum clean      // As above, clear the software package and old headers under the cache directory (/ var / cache / Yum)

Yum command usage instance

1. Upgrade system

#yum update

2. Install the specified package

# yum -y install vsftpd

3. Upgrade the specified package

# yum -y update mysql

4. Uninstall the specified package

# yum -y remore vsftpd mysql

5. View the installed and available software groups in the system. For the available software groups, you can choose to install

# yum grouplist

6. Install one of the available software groups shown in the previous command, divine editor Emacs, with about 12 packages installed

# yum -y groupinstall Emacs

7. Updates the packages in the specified software group

# yum -y groupupdate Emacs

8. Uninstall the packages in the specified software group. For Emacs, 12 packages were installed during installation, but only 4 packages were uninstalled during uninstallation!

# yum  -y  groupremove  Emacs

9. Clear the RPM header file and package file in the cache

# yum  clean  all

10. Search for related packages

# yum  -y search  Emacs

11. Displays information for the specified package

# yum  info  Emacs

The information displayed by rpm -qi Emacs is similar, but not exactly the same

12. Query the dependency information of the specified software package. Emacs depends on many modules

# yum  deplist  emacs

13. Lists all packages starting with yum

# yum  list  yum*

14. Lists RPM packages that are installed but not included in the repository

# yum  list  extras

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]