Introduction to RPM Commands-(go from jb51.net)

Source: Internet
Author: User
Tags ftp site

In the Linux operating system, there is a system package that functions like "Add/Remove Programs" in Windows, but is much more powerful than Add/Remove Programs, which is red Hat package Manager (RPM). In the Linux operating system, there is a system package that functions like "Add/Remove Programs" in Windows, but is much more powerful than Add/Remove Programs, which is red Hat package Manager (RPM). The 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 remove software under Linux. Here is a brief introduction to the use of its specific methods.

1. We get a new software, before the installation, it is generally necessary to check the contents of this package, assuming that 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 the details of the package, including information about how many files, file names, file size, creation time, compile date, and so on.

2. All the files listed above are not necessarily installed at the time of installation, just like Windows under the installation of the program is divided into typical, full, custom, Linux will let you choose the installation method, at this time we can use this command to see the package will be installed in the system which parts, in order to facilitate our choice:
RPM-QPL linux-1.4-6.i368.rpm

3. After selecting the installation method, start the installation. We can install this software with the RPM-IVH linux-1.4-6.i368.rpm command. During the installation process, if you are prompted to install the software or for other reasons, but if we do want to execute the installation command, you can add a parameter "-replacepkgs" after-IVH:
rpm-ivh-replacepkgs linux-1.4-6.i368.rpm

4. Sometimes we uninstall one of the installed software, just execute rpm-e < file name > command.

5. Upgrading low-version software is a good way to improve its functionality, so as to save us the hassle of installing new software after uninstalling, in order to upgrade a software, only need to execute the following command: RPM-UVH < filename;, note: The file name at this point must be the upgrade patch to upgrade the software
6. Another way to install the software is the uniqueness of Linux, but also a manifestation of RMP's powerful features: Install the software directly online via the FTP site. Once you have found the site containing the software you need and connected to this website, execute the following command to install online, for example, to install linux-1.4-6.i368.rpm online, you can use the command:

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

7. In our use of the computer process, it will inevitably be wrong to operate, if we mistakenly deleted a few files and affect the performance of the system, how to find out what exactly is missing files? The RPM package provides a function to find corrupted files and execute this command: Rpm-va, Linux will list all corrupted files for you. You can fix it through the Linux installation CD.

8.Linux system of many files, in the course of use, will inevitably encounter the files we do not know, under Windows we can use the "Start/Find" menu to quickly determine which folder a file belongs to, in Linux, The following command line can help us quickly determine which package a file belongs to:

RPM-QF < file name >

9. When each package is installed on a Linux system, the installation files will be "checked in" in the RPM database, so we need to look up the properties of one of the installed software just to find it in this database. Note: The query command at this point is different from the query described in 1 and 8, and this method only applies to packages that have already been installed! Command format:

RPM-Parameters < file names >

Under the Linux operating system, almost all of the software is installed, uninstalled and managed through RPM. RPM is all called the Redhat Package Manager, and is a software proposed by Redhat Corporation to manage packages under Linux. Linux installation, in addition to a few core modules, almost all the remaining modules are installed through the RPM. RPM has five modes of operation: Install, uninstall, upgrade, query and verify.

RPM Installation operation

Command:

Rpm-i The package file name that needs to be installed

Examples are as follows:

Rpm-i example.rpm installation example.rpm package;

Rpm-iv example.rpm installs the example.rpm package and displays the file information that is being installed during the installation process;

RPM-IVH example.rpm installs the example.rpm package and displays the file information and installation progress during the installation process;

RPM Query Operation

Command:

Rpm-q ...

Additional query commands:

A query all installed packages The following two additional commands are used to query the installation package information;

I display the information of the installation package;

L Display the directories in which all files in the installation package are installed;

s displays the status of all files in the installation version and which directories are installed; The following two additional commands are used to specify whether the installation package or the installed file needs to be queried;

P The information of the installation package is queried;

f The query is a file information that has been installed;

examples are as follows:

Rpm-qa | grep tomcat4 to see if TOMCAT4 is installed;

RPM-QIP example.rpm View the information of the example.rpm installation package;

RPM-QIF/BIN/DF View information about the installation package where the/bin/df file is located;

RPM-QLF/BIN/DF to see which directory each file in the installation package of the/BIN/DF file is installed in;

RPM unload operation

Command:

RPM-E installation packages that need to be uninstalled

Before uninstalling, it is usually necessary to use the rpm-q ... command to isolate the name of the installation package that needs to be uninstalled.

Examples are as follows:

RPM-E TOMCAT4 Uninstall TOMCAT4 Package

RPM Upgrade Operation

Command:

Rpm-u packages that need to be upgraded

Examples are as follows:

RPM-UVH example.rpm Upgrade EXAMPLE.RPM Package

RPM Verification Action

Command:

RPM-V packages that need to be validated

Examples are as follows:

Rpm-vf/etc/tomcat4/tomcat4.conf

The output information is similar to the following:

S.5 .... T c/etc/tomcat4/tomcat4.conf

Where S means that the file size has been modified and T indicates that the file date has been modified. For more information, please refer to the RPM Help file: Man rpm

other additional commands for RPM

--force mandatory operation such as forced installation and removal;
--requires shows the dependency of the package;
--nodeps ignore dependencies and continue operation

If you have questions about this article, please submit to the Exchange community, the vast number of enthusiastic netizens will answer for you!! Click to enter the community

Introduction to RPM Commands-(go from jb51.net)

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.