RPM package management

Source: Internet
Author: User

The RPM package manager can be used to package compiled programs. This package can be used for installation, upgrade, downgrade, unmount, query, verification, package database management, and other functions. Although rpm is much easier to install than source code, it is still a headache of dependency. Yum (APT-Get of ubuntu) is used to solve this problem ). When RPM makes the source code into an RPM package, it usually uses a subcontracting mechanism to package each function into a package, which is generally composed of a main package and several sub-packages. The sub-package depends on the main package. Provides a unified installation and management function for the program. Package composition:

1. Database

Program name and version, used for upgrade and downgrade,

Dependency, which depends on other software packages.

Functional Description Summary

Install the generated file path and file verification code.

2. program composition list

File List

The script that runs during installation and uninstallation. If the program runs as a user, you must create a user during installation and delete the user during uninstallation. There are four types of User Guide

Script before installation, script after installation, script before uninstallation, script after uninstallation.


Rpm Command Format: program name: .tar. {GZ, bz2, xz}. The version numbers are: Major version number-minor version number-Release number. The sub-package is generally described as functional.


RPM package access channels are, the system installation disc, the release of the home page, mirror station such as http://mirrors.163.com http://mirrors.sohu.com. The software project's official website is a third organization or individual, such as the epel of Fedora. Like http://rpmfind.net and http://rpm.pbone.net


Rpm RPM program installation command
-I installation, install. Follow the RPM package name
-E uninstall, followed by the program name. There will also be dependencies during uninstallation.
If there is a dependency, there are two methods: 1. Uninstall other programs that depend on this package. 2. Ignore the dependency. The program that depends on this package may run abnormally.
If it has been changed after installation, it will not be uninstalled but will be renamed and retained.

-V: Show Details
-VV: displays more detailed information.
-Vvv: More detailed information
-H: Use # To display the installation progress. The installation progress is # 2%.
-- Test to test whether the RPM package can be installed. Only tests will not be installed.
-- Nodeps ignore dependency
If there is a dependency, either package the dependency or ignore the dependency, but this is relatively unreliable, it may cause the installed software to fail.
-Replacepks overwrite the installer before installation. During the re-installation, if the original configuration file is modified, it is likely not to be replaced, but to rename the new configuration file generated by this program to the file ending with. rpmnew. You need to rename it.

-U upgrade or installation. The upgrade deletes the old version and installs the new version. If the old program is not installed, install it.
-F is a pure upgrade. If this program is not installed before, it will not be installed.
-- Force update. Other Software dependent on this package may not run properly. The kernel should be installed and should not be upgraded.
-Q: Check whether a package is installed. Q is followed by the package name. Multiple packages can be queried at a time, separated by spaces.
-QA: Query all installed packages
-Qi: query the function description of an installed package
-QL queries an installation package and generates the files after installation. The package name must be added after QL.
-QC queries the configuration files generated after a package is installed.
-Qd query the help files generated after a package is installed
-Q -- scripts: query the scripts related to a package. Follow the package name.

-QF queries which package generates a file. Follow the path of the file to be queried.
-P: query the system related to an uninstalled package. Follow the package name.
Common combinations
-QPI
-Qpl
-Qpc
-Qpd
-V check to check whether the file attributes are changed after a package is installed. For example, the configuration file has not been modified after a package is installed. Follow the package name

Source legitimacy, I integrity test. You must import the public key of both production and production on the current system.
-- Import the public key, followed by the public key name. You can import multiple-in public keys.
Rpm-Qa GPG-pubkey * displays the imported public key.
Rpm-Qi displays the details of a key, followed by the key name.
-K check the integrity of the check package, which is automatically checked during installation. The name of the package that follows. Import the key before performing the check.
-K -- nodigest does not check package integrity
-K -- nosignature does not check the package source Validity

The RPM database directory is in/var/lib/RPM. If it is damaged, it can be rebuilt using either of the following methods:
Rpm -- initdb initialization. If no database exists, a new one is created. If yes, this command is not executed.
Re-build rpm -- rebuilddb to directly overwrite the original database.


This article from the "red face easily die lofty sentiments long" blog, please be sure to keep this source http://wukui.blog.51cto.com/1080241/1531062

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.