The use of RPM

Source: Internet
Author: User

The RPM full name is Redhat Package Manager, referred to as RPM, also known as the RPM Package Manager, which makes one of the Redhat suite management programs similar to the Add Delete module in Windows Control Panel, The Windows Add-Remove program logs the installation information in the registry to facilitate program updates and uninstall. RPM also has a similar function for installing and managing a suite of Linux packages.

Introduction and function of RPM and srpm

1. rpm:rpm installs the required suite into a Linux system by using a database record. The format of the RPM package is the *.RPM,RPM package for the compiled and packaged RPM files, which is the most characteristic. Similar to our common software installation, before installing the required kits, check the environment required for the suite installation based on the installation parameters provided in the suite, if the system's environment is consistent with the environment required in the suite (the environment when the package is packaged), you can install it successfully, or you will be prompted for an error, or you may be prompted to install the dependency property module , you need to install a certain kit before you can install the kit. After the suite is successfully installed, the RPM Suite Manager logs the installed package to the RPM database for subsequent queries, validations, upgrades, uninstall, and so on.

2. SRPM: With the largest characteristics of RPM, srpm is included in the source code rpm, that is, SRPM provides the content for the source code, of course, has not been compiled. The srpm also provides parameter profiles (configure and Makefile). Presumably everyone already knows that it's the biggest difference with RPM is that you need to compile the kit in RPM management by the RPM manager, modify the parameter profile according to the system environment, and then install the compiled RPM into the Linux system. It can be seen that srpm modified the parameter profile at compile time without being consistent with the packaged environment, thereby reducing the installation environment required for the package.

Ii. the format and description of the RPM,SRPM package

The format of 1.RMP and srpm is usually:

*.rpm such as: compat-db-4.1.25-9.i386.rpm

*.src.rpm such as: compat-db-4.1.25-9.i386.src.rpm

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/soft/tools/

According to the above introduction, COMPAT-DB-4.1.25-9.I386.RPM is a compiled file, compat-db-4.1.25-9.i386.src.rpm is a file that has not been compiled, usually with the RPM and srpm files provided before the package is released.

2. Notes on i386,i686 in the document:

i386 refers to the software package that applies to computers on all x86 platforms above Intel 80386.

i686 refers to the software package that applies to computers in Intel's x86 platform over 80686, Pentinum II, after the Intel series, K7 later level CPUs.

Noarch means that this package is not related to the hardware architecture and can be generic.

3. File name and version of the kit:

As described above compat-db-4.1.25-9 the name of the kit is compat-db,4.1.25-9 as version information and the number of times it is published.

Third, the RPM query function

1. Format: [root@localhost ~]# rpm-parameter package_name

RPM Query path: The database file in the/var/lib/rpm directory.

Parameter description:

-Q: Lists whether package_name is installed in the system.

-QA: Queries all packages installed in the system.

-QL: Queries the installation path for all files in Package_name.

-qi: List details of package_name, including developer, version, description, etc.

-V: If Package_name has been modified, it is listed.

2. Below we will install Oracle 10g in RHEL5.4 to introduce the RPM query function by querying the required software packages.

Sample 1: Query whether a suite has been installed, if you want to query whether the BINUTILS-2.15.92.0.2-13.EL4 has been installed, as follows:

[Root@localhost ~]# rpm-q binutils

BINUTILS-2.17.50.0.6-12.E15-Indicates that the package binutils has been successfully installed and the version number listed is higher than the version you are querying.

[Root@localhost ~]# rpm-q compat-db

Package COMPAT-DB is not installed--indicates that package COMPAT-DB has not been installed in the system

Sample 2: Query Binutils-2.15.92.0.2-13.el4 For more information:

[Root@localhost ~]# Rpm-qi binutils--result omitted

SAPMLE 3: Query all directories and files for Binutils-2.15.92.0.2-13.el4:

[Root@localhost ~]# rpm-ql binutils--result omitted

Four, RPM's safety loading and unloading function

Through the RPM query function, we can get some packages installed in the system and list their path, details and so on. For those systems that are not installed in the system and that need to be installed because of dependencies on the program, we can also do it through RPM, as described above, just to give the rpm different parameters. You can, of course, upgrade or uninstall the packages that you have installed.

1. Install package. Like the format described in the RPM query function, just change the parameter to IVH. IVH are usually grouped together and can be used separately. I represent the meaning of install, and V means to display more detailed installation information, h indicates the installation progress. Therefore, I prefer to use the above three parameters at the same time.

Sample 1: Install the nonexistent compat-db package as described in the previous section

[Root@localhost ~]# RPM-IVH compat-db-4.1.25-9

Google can search the software package, or to the following URL download: http://linuxsoft.cern.ch/cern/slc4X/i386/yum/os/repodata/repoview/compat-db-0-4.1.25-9.html

Of course, you can install the package through the Web site, provided your Linux system is connected to the Internet properly.

such as: [Root@localhost ~]# RPM-IVH http://linuxsoft.cern.ch/cern/slc4X/i386/yum/os/compat-db-4.1.25-9.i386.rpm

Sample 2: Install multiple packages at the same time, as long as there are multiple packages behind the parameter IVH, make sure that the path can correctly find the package you need.

[Root@localhost ~]# RPM-IVH compat-db-4.1.25-9 compat-libstdc++-296-2.96-132.7.2

2. Update and Uninstall Package

This includes updating packages and uninstalling packages, described separately below.

To update the package, the following only provides parameter descriptions, and the command format specification is described in the previous paragraph:

Parameters:-FVH, for installed legacy packages, the system is automatically updated and will not be updated for subsequent package systems that are not installed.

-UVH, for installed legacy packages, the system is automatically updated and installed directly for subsequent package systems that are not installed.

When uninstalling a package, the following only provides parameter descriptions, and the command format specification is described in the previous paragraph:

Parameters:-E Uninstalls the package specified in Package_name.

Note: The use of srpm involves compiling a process that is not described here.

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.