RPM Package Management

Source: Internet
Author: User

One, how to install the program under Linux

The program is compiled from source code, and under Linux We can install the software by compiling the source code. However, this method is relatively high for operators, and in the process of compiling a variety of files necessary to run the program, these files are placed in different directories in the system, not easy to manage. As a result, publishers of Linux distributions typically compile the source program, provide it to the user in a specific organization form, and provide the appropriate package management tools to manage such packages. RPM is a class of package managers.

RPM was first applied to the Linux distributions of the Redhat series, and now it has been set by the LSB (Linux Standard Board) as the industry standard for Package Manager on Linux with its outstanding features.

Second, RPM package introduction

generally speaking, the program consists of binary files, library files, configuration files, help files, etc., four parts, according to the FHS specification specified by the LSB, these files need to be placed under different paths (of course, this is not necessary, not in the prescribed path, the program may not be able to run), Using the RPM Package Manager manager, the /var/lib/rpm generates a database file that records the details of the installer to facilitate later uninstallation, upgrades, queries, and so on.

To install the software using RPM, you must first have the RPM package under the corresponding platform. The way packages are named is generally the case: appname-version-release.arch.rpm, such as zsh-4.3.10-9.el6.x86_64.rpm, has information about the version platform, When using the RPM package, be sure to select the corresponding package.

Third, how to use rpm

As a package manager, its functions mainly include: installation, uninstall, upgrade, query, checksum five aspects of the content below we will briefly introduce their usage.

1, installation

Syntax: rpm {-i|--install} [install-options] package_file1 ...

The simplest command to install a package can be expressed as rpm-i package.rpm. Of course RPM also offers more options for us to use, common installation options are:

-V: Displays the installation process, and-VV indicates a more detailed installation process is displayed.

-H: Displays the installation progress in the form of #, with each # number representing 5% progress.

--test: Does not perform a real installation process, but only reports dependencies and conflicting information.

--nodeps: Indicates that the dependency relationship is ignored and continues to install when the package that the installer relies on does not exist. This can cause the program to run successfully, although the installation is successful.

--force: Force the installation of the package.

--relocate: Locate the installation path of the package that allows you to modify the installation path to the new path. Many packages are not allowed to modify the installation path of the OH.

2, uninstall

Syntax: rpm {-e|--erase} [--allmatches] [--nodeps] [--test] package_name ...

To uninstall a package, you only need to specify the installed RPM package registration. Personally, there are two main options that are commonly used for uninstallation:

--nodeps: Ignore dependencies, that is, when the software being uninstalled is dependent on other software, ignore the dependency and proceed with the unload behavior.

--test: Test Uninstall, do not perform the actual uninstallation process.

3, upgrade

The options associated with the upgrade are two-F and-u, which differ between the two options.

Rpm{-f|--freshen} [install-options] package_file ... Indicates that if the program to be upgraded does not have an old version, the installation process is not performed and an old version exists, then the upgrade installation process is performed.

        RPM {-u|--upgrade} [install-options] package_file ... Indicates that if the installation package to be upgraded has already been installed, the upgrade is not installed and the installation process continues.

Use-F or-u to choose according to our needs OH.

4, query

A feature that a person feels is very important.

Syntax rpm {-q|--query} [select-options] [query-options]

   rpm-q package_name: Displays information about packages that have already been installed.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/77/wKioL1Uub7GDWPZKAACaBOgtHRs263.jpg "title=" 1.png " alt= "Wkiol1uub7gdwpzkaacabogthrs263.jpg"/>

RPM-QA: Displays all packages that have been installed on the system. Of course, we can do other things with the pipe command.

RPM-QF file_name: Query which package installs a file for build.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/7B/wKiom1Uub5aCgBQuAAC-JWMoys4495.jpg "title=" image 076. PNG "alt=" wkiom1uub5acgbquaac-jwmoys4495.jpg "/>

Rpm-qi package_name: Query the brief description of a package that has already been installed,Package_name refers to AppName in APPNAME-VERSION-RELEASE.ARCH.RPM, not the file name of the installation package file.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/77/wKioL1Uucw_x1BkoAALoDKxDpRo616.jpg "title=" image 077. PNG "alt=" wkiol1uucw_x1bkoaalodkxdpro616.jpg "/>

RPM-QL package_name: Querying a list of files generated by a package

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/77/wKioL1Uuc5OQROOPAABgD7ekmGw769.jpg "title=" image 078. PNG "alt=" wkiol1uuc5oqroopaabgd7ekmgw769.jpg "/>

RPM-QC package_name: Queries all configuration files that are generated when a package is installed.

RPM-QD package_name: Queries all help files that are generated after the installation of a package is complete.

Rpm-q--changelog: Look at the changelog information of a package when it is made, to understand the package's past life, it is very useful oh.

Rpm-q--provides package_name: Queries the capabilities provided by a package.

Rpm-q--requires package_name: Queries the capabilities that a package depends on.

5, check

Common usage: rpm-v package_name, after the query package installation is complete, whether it has been modified, including the configuration file.


RPM Package Management

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.