Linux rpm command parameters to use the detailed

Source: Internet
Author: User
Tags documentation

RPM Execution Installation package

Binary package (Binary) as well as source code package (sources) two. The binary package can be installed directly on the computer, and the source code package will be automatically compiled and installed by RPM. Source code packages often use src.rpm as the suffix name.

It is not clear what the use, only know can check whether a software installation. For example: Rpm-qa |grep rsync
-I,--install install package (s)
-V,--verbose provide more detailed output
-H,--hash print hash marks as package installs (good with-v)
-E,--erase Erase (Uninstall) package
-U,--upgrade=<packagefile>+ upgrade package (s)
--replacepkge Install packages Regardless of whether the package has been installed
--test installation test, not actually installed
--nodeps Ignore package dependencies forced installation
--force ignores package and file conflicts

Query options (With-q or--query):
-A,--all query/verify all packages
-P,--package query/verify a package file
-L,--list list files in package
-D,--docfiles list all documentation files
-F,--file query/verify package (s) owning file
Command format
RPM {-q|–query} [select-options] [query-options]
RPM Query function is extremely powerful, is one of the most important functions; For a few common examples, more detailed specific, please refer to #man rpm
1, the system has installed the software query;
1 Query the system has installed software;
Syntax: RPM-Q software name
Example:
[Root@localhost beinan]# rpm-q Gaim
Gaim-1.3.0-1.fc4
Q is –query, the Chinese meaning is "ask", this command indicates that the system is not installed Gaim, if the installation will have information output, if not installed, will output Gaim not installed information;
View all installed packages in the system, plus a parameter;
[Root@localhost rpms]# Rpm-qa
If paging view, add a pipe | and more command;
[Root@localhost rpms]# Rpm-qa |more
Find a software in all installed packages, such as Gaim, which can be extracted using grep;
[Root@localhost rpms]# Rpm-qa |grep Gaim
The above function is the same as the result of rpm-q gaim output;
2 Query a file that has been installed to which package;
Syntax RPM-QF file name
Note: The absolute path to the filename is indicated
Example:
[Root@localhost rpms]# rpm-qf/usr/lib/libacl.la
Libacl-devel-2.2.23-8
3 Find out where the installed packages are installed;
Syntax: RPM-QL software name or rpm RPMQUERY-QL software name
Example:
[Root@localhost rpms]# RPM-QL Lynx
[Root@localhost rpms]# RPMQUERY-QL Lynx
4 Query The information of an installed package
Syntax format: RPM-QI software name
Example:
[Root@localhost rpms]# Rpm-qi Lynx
5 Check the configuration file of the installed software;
Syntax format: RPM-QC software name
Example:
[Root@localhost rpms]# RPM-QC Lynx
6 to view a document installation location where the software has been installed:
Syntax format: RPM-QD software name
Example:
[Root@localhost rpms]# RPM-QD Lynx
7 Check the software packages and files that have been installed;
Syntax format: RPM-QR software name
Example:
[Root@localhost beinan]# RPM-QR Rpm-python
A summary of the query installed software: For a package has been installed, we can combine a series of parameters, such as Rpm-qil, such as:
[Root@localhost rpms]# Rpm-qil Lynx
Delete an RPM package;
First you have to learn to query the RPM package, please see the previous description;
[Root@localhost Beinan] #rpm-E package Name
For example: I want to remove the Lynx package, the complete operation should be:
[Root@localhost rpms]# rpm-e Lynx
If there is a dependency, you can also use –nodeps to ignore dependency checks to remove them. But as far as possible do not do so, it is best to use Package Manager systerm-config-packages to remove or add software;
[Root@localhost beinan]# rpm-e lynx–nodeps

Common Command combinations:


-IVH: Installation shows installation progress--install--verbose--hash
-UVH: Upgrade package--update;
-QPL: List the file information in the RPM software package [Query Package list];
-QPI: Lists the description information for the RPM package [Query Package install Package (s)];
-QF: Find out which RPM package the specified file belongs to [Query file];
-va: Check all RPM packages, find missing files [View Lost];
-E: Deleting packages

Rpm-q Samba//query program is installed

RPM-IVH/MEDIA/CDROM/REDHAT/RPMS/SAMBA-3.0.10-1.4E.I386.RPM//Installation and display progress by path
RPM-IVH--relocate/=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm//Specify installation directory

RPM-IVH--test gaim-1.3.0-1.fc4.i386.rpm//for checking dependencies; not real installation;
RPM-UVH--oldpackage gaim-1.3.0-1.fc4.i386.rpm//New version degraded to previous version

Rpm-qa | grep httpd #[Search Specifies whether the RPM package is installed]--all search *httpd*
RPM-QL httpd #[Search RPM Package]--list all file installation directories

Rpm-qpi linux-1.4-6.i368.rpm #[View RPM Package]--query--package--install package Information
RPM-QPF linux-1.4-6.i368.rpm #[View RPM Package]--file
RPM-QPR file.rpm #[View Package] Dependencies
Rpm2cpio file.rpm |cpio-div #[extract file]

RPM-IVH file.rpm #[Install a new Rpm]--install--verbose--hash
Rpm-ivh

RPM-UVH file.rpm #[Upgrades a rpm]--upgrade
Rpm-e file.rpm #[Delete an RPM package]--erase


Common parameters:

Install/upgrade/erase options:

-I,--install install package (s)
-V,--verbose provide more detailed output
-H,--hash print hash marks as package installs (good with-v)
-E,--erase Erase (Uninstall) package
-U,--upgrade=<packagefile>+ upgrade package (s)
--replacepkge Install packages Regardless of whether the package has been installed
--test installation test, not actually installed
--nodeps Ignore package dependencies forced installation
--force ignores package and file conflicts

Query options (With-q or--query):
-A,--all query/verify all packages
-P,--package query/verify a package file
-L,--list list files in package
-D,--docfiles list all documentation files
-F,--file query/verify package (s) owning file

RPM Source Code Packaging installation

. src.rpm end of the file, these files are packaged by the source code of the software, the user to install such RPM software package, you must use the command:

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

RPM--rebuild vim-4.6-4.src.rpm # After the installation is complete, the compiled executable file is also repackaged into the i386.rpm RPM package.

Related Article

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.