Linux (18) RPM

18.1 Introduction

A packaging and installation tool for Internet download packages, which is included with some Linux distributions. It generates files with .RPM extension. RPM is an acronym for RedHat Package Manager (RedHat Package Management Tool). Similar to the setup.exe of windows, although the name of this file format is marked with the RedHat logo, the concept is universal.

Linux distribution versions are used (suse, redhat, centos, etc.), which can be regarded as the industry standard.

18.2 Simple query command for rpm package:

Query installed rpm list rpm -qa | grep xx

Check if the current linux has firefox installed.


 

The basic format of rpm package name:

firefox-45.0.1-1.el6.centos.x86_64

Name: firefox

Version number: 45.0.1-1

Applicable operating system: el6.centos.x86_64 (indicates the 64-bit system of centos6.x, if it is i686, i386 means 32-bit system, noarch means general)

18.3 Other query commands for rpm packages

rpm -qa: Query all installed rpm packages

rpm -qa | more: paging display

rpm    -qa    |    grep    xxx

rpm -q xxx: Query whether the package is installed

rpm -qi xxx: Query package information

rpm -ql xxx: query files in packages

rpm -qf file full path name: query the package to which the file belongs

18.4 Uninstall rpm package

rpm -e the name of the package


 

Details:

(1) If other packages depend on the package you want to uninstall, an error message will be generated when uninstalling.

(2) If we just want to delete this package, we can add the parameter --nodeps to force deletion, but this is generally not recommended, because programs that depend on this package may not run.

18.5 Install rpm package

rpm -ivh package full pathname

i=install install

v=verbose hint

h=hash progress bar

Note: First mount the iso file where we installed centos, and then go to /media/ to find the rpm package. It will be installed by default.


 

install firefox

(1) First enter the Packages directory to find out whether there is a firefox installation package


 

(2) Generally, it is not installed in this file directory, copy it to /opt


 

(3) Installation


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325088276&siteId=291194637