CentOS7 About the installation, uninstallation and viewing of RPM packages

First make sure that the CD in the virtual machine is in use

 The small optical drive icon must be lit

 

 Contents of /mnt/ before mounting the CD-ROM

 Mount the CD-ROM to the /mnt directory mount /dev/cdrom /mnt

 /dev/sr0 is write-protected, it will be mounted in read-only mode, and the CD-ROM is mounted in read-only mode

Check the directory /mnt again, and now the content of the directory is the content of the CD

 The /mnt/Packages/ directory is the rpm package that can be installed, and 10 packages are displayed here

 The name of each RPM package has - and . Divided into several parts. For example, in the abrt-2.1.11-60.el7.centos.x86_64.rpm package, abrt is the package name, 2.1.11 is the version information, 45.el7.centos is the release version number, and x86_64 is the operating platform.

Common operating platforms are i386, i586, i686 and x86_64. Among them, i386, i586 and i686 are all 32-bit platforms, while x86_64 is a 64-bit platform. In addition, some RPM packages do not write specific platforms, but noarch (such as ant-1.9.4-2.el7.noarch.rpm), which means that this RPM package has no hardware platform restrictions.

To install the Rpm package, we first switch to the /mnt/Packages/ directory, search for the libjpeg-turbo-devel-1.2.90-8.el7.x86_64.rpm package, and then install it

 The meaning of each option:
-i: indicates installation
-v: indicates visualization
-h: indicates installation progress
In addition, when installing an RPM package, commonly used additional parameters include the following items.
--force: Indicates mandatory installation, even if files belonging to other packages are overwritten.
--nodeps: Indicates that when the RPM package to be installed depends on other packages, even if other packages are not installed, this package must be installed

The command to upgrade the RPM package is rpm -Uvh filename, where the -U option means upgrade

Uninstall the RPM package rpm -e filename First find an installed package, and then use the -e option to uninstall it

 When uninstalling, you can also use the -v option to visualize the uninstallation process, and the -h option to display the uninstallation progress

 Query whether a package has been installed: rpm -q package name, the package name here is without platform information and suffix name.

 Query all installed RPM packages in the current system. Due to space limitations, here are the first 15 packages

 Query information about an installed RPM package: rpm -qi package name, the package name here does not need to add platform information and suffix name

 As can be seen from the following Summary and Description, the contents of this package include header files for processing JPEG files

List the installation files of an RPM package

 As can be seen from the above command, the file /usr/lib64/libjpeg.so is obtained by installing the RPM package libjpeg-turbo-devel. This package also provides how to use its example.c file.

List which RPM package a file belongs to rpm -qf Absolute path of the file

Guess you like

Origin blog.csdn.net/yanzhenxi/article/details/127345802