Linux rpm commands

Source: Internet
Author: User

Linux rpm commands

I. Introduction

RPM is the abbreviation of RedHatPackageManager. It is a software package installation and management program developed by RedHat, which is similar to the Uninstaller on Windows platform. With RPM, you can install and manage applications and System Tools on Linux. RPM allows you to directly install the software package in binary mode and query whether the related library files have been installed for you. When you delete a program using RPM, it also intelligently asks the user whether to delete the relevant program. If you use RPM to upgrade the software, RPM retains the original configuration file so that you do not need to reconfigure the new software. RPM retains a database that contains all the software package materials. Through this database, you can query the software package. Although RPM is designed for Linux, it has been moved to SunOS, Solaris, AIX, Irix and other UNIX systems. RPM complies with the GPL copyright agreement, and users can freely use and disseminate RPM under the conditions that comply with the GPL protocol.

Ii. Configuration

The configuration file for RPM package management is rpmrc. You can use the following command to find

# Locate rpmrc

You can run the following command to view

Rpm -- showrc

Iii. Functions

1. initialize the rpm database function;

Run the rpm command to check whether an rpm package is installed. The rpm database is also used. Therefore, we often use the following two commands to initialize the rpm database;

[Root @ localhost beinan] # rpm -- initdb
[Root @ localhost beinan] # rpm -- rebuilddb Note: This takes a long time;
Note: The above two parameters are extremely useful. Sometimes the rpm system has a problem and cannot be installed or queried. Most of the problems are found here;

[Root @ localhost beinan] # updatedb

[Root @ localhost beinan] # locate software name or file name

Tip: Through updatedb, we can use locate to query where some software has been installed. The system will execute updatedb for the first installation and will execute it once every other time; to keep the installed software library up-to-date; updatedb is owned by the slocate software package; if you do not have this command, you must install slocate;
 

2. RPM software package management

1) query function:

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

Use instance

1) query the software package of an installed file

Rpm-qf file name

2) query where all installed software packages are installed

Rpm-ql software name
Or
Rpm rpmquery-ql software name

3) Check the configuration file of the installed software.

Rpm-qc software name

4) view the installation location of a document that has installed the software.

Rpm-qd software name

5) Check the software packages and files on which the software is installed.

Rpm-qR software name

6) view the files contained in a software package

Rpm-qpl file name

 

2) installation, upgrade, and deletion of software packages

1) general package installation

-Ivh: the installation progress is displayed. -- install -- verbose -- hash
-Uvh: Upgrade the software package -- Update;
-Va: Check all RPM software packages and find the missing file [View Lost].
-E: delete a package

2) install the source code package

Rpm -- recompile vim-4.6-4.src.rpm # This command will unpackage the source code and compile and install it if the user uses the command:

Rpm -- rebuild vim-4.6-4.src.rpm # After installation is complete, the compiled executable files are repackaged into the i386.rpm RPM package.
 
See: http://ftp.tsingpost.com/index.php/archives/379/ for detailed usage

 

3) network package installation

# RPMS-qpi http://mirrors.kernel.org/Fedora/core/4/i386/ OS/Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm
# Rpm-ivh http://mirrors.kernel.org/fedora/core/4/i386/ OS/Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm.

4) Specify the installation directory: add the-relocate Parameter

Rpm-ivh -- relocate/=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm # The gaim-1.3.0-1.fc4.i386.rpm specifies the installation in the directory:/opt/gaim

 

3. Import Signature

Rpm -- import signature file
 

4. File extraction function of rpm Software Package

Rpm2cpio file. rpm | cpio-div

Tip: The extracted files are stored in usr and etc in the current directory.

Getting started with creating an RPM package

In Linux, how does one create an RPM package?

Create your own rpm package

Directory structure and configuration after rpm installation in Linux

Brief Introduction and demo of rpm and yum

Redhat Linux --- rpm command details

Use FPM to easily create an RPM package

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.