Linux rpm command and linuxrpm command

Source: Internet
Author: User

Linux rpm command and linuxrpm command

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] # The locate software name or file name prompt: Through updatedb, we can use locate to query where some software is installed; the system needs to execute updatedb for the first time and run it at intervals 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 need to 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 software package -- Update;-Va: Check all RPM software packages and find the missing files [View Lost]. -e: delete a package

2) install the source code package

Rpm -- recompile vim-4.6-4.src.rpm # This command unpacks the source code and compiles and installs it if the user uses the command: rpm -- rebuild vim-4.6-4.src.rpm # After the installation is complete, the compiled executable files will be repackaged into an i386.rpm RPM package.

See: http://ftp.tsingpost.com/index.php/archives/379/ for detailed usage

 

3) network package installation

# rpm -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.

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.