Article Directory
rpm package management
Introduction
rpm is a packaging and installation tool for Internet download packages. It is included in some Linux distributions. It generates files with a .RPM extension. RPM is the abbreviation of RedHat Package Manager (RedHat package management tool), similar to Windows setup.exe. Although this file format name is marked with the RedHat logo, the concept is universal.
Linux distribution versions are adopted (suse, redhat, centos, etc.), which can be regarded as a recognized industry standard.
Simple query command of rpm package
Query the list of installed rpms: rpm -qa | grep xx
Example: Check whether firefox is installed in the current system
Basic format of rpm package name
A rpm package name: firefox-78.8.0-1.el8_3.x86_64
Name: firefox
Version number: 78.8.0-1
Applicable operating system: el8_3.x86_64, which means centos8.x 64-bit system
If it is i686, i386 means 32-bit system, noarch means universal
Other query commands of rpm package
-
rpm -qa: Query all rpm packages installed
-
rpm -qa | more
-
rpm -qa | grep X[rpm -qa | grep firefox]
-
rpm -q package name: query whether the package is installed
Case: rpm -q firefox
-
rpm -qi software registration: query software package information
Case: rpm -qi firefox
-
rpm -ql package name: query files in the package
Case: rpm -ql firefox
-
rpm -qf file full path name: query the software package to which the file belongs
Example: rpm -qf /etc/passwd
Uninstall the rpm package
Basic grammar
rpm -e The name of the rpm package (e: erase)
Application case: delete firefox software package
rpm -e firefox
Detailed discussion
- If other software packages depend on the software package to be uninstalled, an error message will be generated when uninstalling
- If you just want to delete this package, you can add the parameter --nodeps to force it to delete, but it is generally not recommended, because doing so will cause other programs that depend on the package to fail to run
Install the rpm package
Basic grammar
rpm -ivh rpm package full path name
Parameter Description
i = install: install
v = verbose: prompt
h = hash: progress bar
Applications
Uninstall and install firefox browser: rpm -e firefox | rpm -ivh firefox-78.8.0-1.el8_3.x86_64.rpm
yum
Introduction
Yum is a shell front-end package manager. Based on rpm package management, it can automatically download and install rpm packages from a specified server, automatically handle dependencies, and install all dependent software packages at once.
The basic instructions of yum
Query whether the yum server has software that needs to be installed
yum list | grep xx software list
Install the specified yum package
yum install xxx: download and install
Application examples of yum
Use yum to install firefox
rpm -e firefox (remove firefox)
yum list | grep firefox
yum install firefox