How to Use RPM command parameters in Linux

Source: Internet
Author: User
Tags ftp site ftp port number

In a Linux operating system, there is a system software package, which functions similar to "Add/delete programs" in Windows, but is much more powerful than "Add/delete programs, it is Red Hat Package Manager (RPM ). This toolkit was first launched by Red Hat and later borrowed by other Linux developers. Because it saves Linux users a lot of time, it is widely used to install and delete software in Linux. The following describes how to use it.

[Root @ ford/root] # rpm-qa | more

◆ 1. We get a new software, before installation, generally should first check what content in this software package, assuming this file is: Linux-1.4-6.i368.rpm, we can use this command to view:

Rpm-qpi Linux-1.4-6.i368.rpm

The system will list detailed information about the software package, including the number of files, file names, file size, Creation Time, and compilation date.

◆ 2. all the files listed above are not necessarily installed at the time of installation, just as the installation methods of Windows programs are classified into typical, complete, and custom. Linux also allows you to choose the installation method, in this case, we can use the following command to check which parts of the software package will be installed in the system to facilitate our selection:

Rpm-qpl Linux-1.4-6.i368.rpm

◆ 3. Select the installation method and start installation. We can install this software with the rpm-ivh Linux-1.4-6.i368.rpm command. During the installation process, if the system prompts that the software has been installed or cannot be installed for other reasons, but if we really want to execute the installation command, you can add the parameter "-replacepkgs" after-ivh ":

Rpm-ivh-replacepkgs Linux-1.4-6.i368.rpm

◆ 4. Sometimes we only need to execute a Software Installation

Rpm-e <File Name> command.

◆ 5. upgrading a lower version of the software is a good way to improve its functions. This saves us the trouble of installing new software after uninstalling it. To upgrade a software, you only need to execute the following command: rpm-uvh <File Name>. Note: The file name must be the patch for upgrading the software.

◆ 6. Another software installation method is unique in Linux and also a powerful RMP function: directly install software online through the FTP site. When you find a site that contains the software you need and connect to this site, execute the following command to achieve online installation, such as online installation of Linux-1.4-6.i368.rpm, you can use the command:

Rpm-I ftp://ftp.pht.com/pub/linux/redhat/...-1.4-6.i368.rpm

◆ 7. During our use of computers, misoperations will inevitably occur. If we accidentally delete a few files and affect the system performance, how can we find out which files are missing? The RPM package provides a function to find corrupted files. Run this command: rpm-Va. Linux will list all corrupted files for you. You can fix the issue through the Linux installation CD.

◆ 8. in Linux, there are many files, which we will inevitably encounter when using. in Windows, we can use the "Start/search" menu to quickly determine which folder a file belongs, in Linux, the following command line can help us quickly determine which software package a file belongs:

Rpm-qf <File Name>

◆ 9. after each software package is installed in Linux, the installation file is "reported" in the RPM database. Therefore, when we want to query the attributes of an installed software, you only need to search for the database. Note: The query command is different from the query commands described in 1 and 8. This method is only applicable to installed software packages! Command Format:

I. Installation

Command Format:

Rpm-I (or -- install) options file1.rpm... fileN. rpm

Parameters:

File1.rpm... fileN. rpm file name of the RPM package to be installed

Detailed options:

-H (or -- hash) outputs the hash mark (''#'') during installation (''#'')

-- Test only tests the installation and does not actually install it.

-- Percent: the installation progress is displayed as a percentage.

-- Excludedocs does not install the document files in the Software Package

-- Includedocs installation document

-- Replacepkgs force the installed software package to be reinstalled

-- Replacefiles: Replace the files of other software packages.

-- Force ignores conflicts between software packages and files

-- Noscripts does not run the pre-Installation and post-installation scripts

-- Prefix <path> install the software package to the path specified by <path>

-- Ignorearch does not validate the structure of the software package

-- Ignoreos does not check the operating system of the software package.

-- Nodeps does not check Dependencies

-- Ftpproxy

-- Ftpport <port> specifies the FTP port number as <port>

General options

-V: display additional information

-Vv: displays debugging information.

-- Root <path> let RPM use the path specified by <path> as the "root directory", so that the preinstallation program and

Installation programs will be installed in this directory

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

-- Dbpath <path> set the path of the RPM data inventory to <path>

Ii. Delete

Command Format:

Rpm-e (or -- erase) options pkg1... pkgN

Parameters

Pkg1... pkgN: package to be deleted

Detailed options

-- Test: only delete the test.

-- Noscripts does not run the pre-Installation and post-installation script programs

-- Nodeps does not check Dependencies

General options

-Vv: displays debugging information.

-- Root <path> let RPM use the path specified by <path> as the "root directory", so that the pre-installation program and post-Installation

All programs are installed in this directory.

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

-- Dbpath <path> set the path of the RPM data inventory to <path>

Iii. Upgrade

Command Format

Rpm-U (or -- upgrade) options file1.rpm... fileN. rpm

Parameters

File1.rpm... fileN. rpm package name

Detailed options

-H (or -- hash) outputs the hash mark (''#'') during installation (''#'')

-- Oldpackage allows "Upgrade" to an old version

-- Test: only test the upgrade.

-- Excludedocs does not install the document files in the Software Package

-- Includedocs installation document

-- Replacepkgs force the installed software package to be reinstalled

-- Replacefiles: Replace the files of other software packages.

-- Force ignores conflicts between software packages and files

-- Percent: the installation progress is displayed as a percentage.

-- Noscripts does not run the pre-Installation and post-installation scripts

-- Prefix <path> install the software package to the path specified by <path>

-- Ignorearch does not validate the structure of the software package

-- Ignoreos does not check the operating system of the software package.

-- Nodeps does not check Dependencies

-- Ftpproxy

-- Ftpport <port> specifies the FTP port number as <port>

General options

-V: display additional information

-Vv: displays debugging information.

-- Root <path> let RPM use the path specified by <path> as the "root directory". In this way, both the pre-installation program and the post-installation program will be installed in this directory.

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

-- Dbpath <path> set the path of the RPM data inventory to <path>

Iv. Query

Command Format:

Rpm-q (or -- query) options

Parameters:

Pkg1... pkgN: Query installed software packages

Detailed options

-P <file> (or ''-'') query the file of the software package

-F <file> queries which software package <file> belongs.

-A: Query all installed software packages.

-- Whatprovides <x> query software packages that provide the <x> Function

-G <group> queries software packages belonging to the <group> group.

-- Whatrequires <x> query all software packages that require the <x> Function

Information options

<Null> displays all the packages.

-I: displays the summary of the software package.

-L display the file list in the Software Package

-C: display the configuration file list

-D: display the document file list

-S: displays the file list in the package and the status of each file.

-- Scripts displays scripts for installation, uninstallation, and validation

-- Queryformat (or -- qf) displays the query information in a user-specified manner.

-- Dump: displays all verified information for each file.

-- Provides: displays the functions provided by the software package.

-- Requires (or-R) shows the functions required by the Software Package

General options

-V: display additional information

-Vv: displays debugging information.

-- Root <path> let RPM use the path specified by <path> as the "root directory". In this way, both the pre-installation program and the post-installation program will be installed in this directory.

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

-- Dbpath <path> set the path of the RPM data inventory to <path>

5. Verify installed software packages

Command Format:

Rpm-V (or -- verify, or-y) options

Parameters

Pkg1... pkgN name of the software package to be verified

Package options

-P <file> Verify against package file <file>

-F <file> verifies the software package to which <file> belongs

-A Verify: verifies all software packages.

-G <group> verifies all software packages that belong to the group <group>.

Detailed options

-- Noscripts does not run the validation script

-- Nodeps does not verify Dependencies

-- Nofiles does not verify file attributes

General options

-V: display additional information

-Vv: displays debugging information.

-- Root <path> let RPM use the path specified by <path> as the "root directory". In this way, both the pre-installation program and the post-installation program will be installed in this directory.

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

-- Dbpath <path> set the path of the RPM data inventory to <path>

6. Verify the files in the Software Package

Syntax:

Rpm-K (or -- checksig) options file1.rpm... fileN. rpm

Parameters:

File1.rpm... fileN. rpm package file name

Checksig -- detailed options

-- Nopgp does not verify the PGP Signature

General options

-V: display additional information

-Vv: displays debugging information.

-- Rcfile <rcfile> sets the rpmrc file to <rcfile>

VII. Other RPM options

-- Rebuilddb: rebuilding the RPM Database

-- Initdb creates a new RPM Database

-- Quiet: reduce output as much as possible

-- Help: display the help File

-- Version: displays the current version of RPM.

Related Articles]

  • RPM Packaging Technology and Analysis of Typical SPEC files
  • Patch the software packaged by RPM
  • Create an RPM package in Linux

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.