RPM installation commands for Linux commands

Source: Internet
Author: User

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 .

1) Install the package with RPM, the simplest command is as follows:

1 #rpm-I example.rpm install example.rpm package, 2 #rpm-iv example.rpm install example.rpm package and display the file information that is being installed during installation; 3 #rpm-ivh example.rpm ann Install the EXAMPLE.RPM package and display the installed file information and installation progress during the installation process


2) Remove the installed packages
To uninstall the package example, simply enter the following line command:

1 # RPM-E Example

Note: The package name is example, not the rpm filename "example.rpm".

3) Upgrade Package
Upgrading software is similar to installing software:

1 # RPM-UVH example.rpm

The user should note that RPM will automatically uninstall the old version of the corresponding package. If the old version of the software configuration file is incompatible with the new version, RPM will automatically save it as a different file, the user will see the following information:

Saving/etc/example.conf As/etc/example.conf.rpmsave

This allows the user to manually change the corresponding configuration file.
In addition, if users want to install the old version of the software, the user will see the following error message:

# RPM-UVH Example.rpmexamle packag example-2.0-l (which is newer) was already installederror:example.rpm cannot be Installe D

Use the-oldpackage parameter if the user wants to force the installation.

4) Query Package
Users can use Rpm-q in the RPM database to query the corresponding software, RPM will give the package name, version, release version number, for example:

1 # rpm-q Example

The following are the specific parameters that can be used when querying:
-A: Queries All packages that are currently installed on the system.
-F File Name: Query the package that includes the file.
-F: With-f parameter, just input is standard input (e.g. Find/usr/bin | RPM-QF)
-Q Package Name: Query the Package
-Q: With the-p parameter, just the input is the standard input (e.g. Find/mnt/cdrom/redhat/rpms | RPM-QQ)
Here is the format selection at output:
-I displays the package name, description, release, size, compile date, installation date, developer and other information.
-L Displays the files that the package contains
-S displays the current state of the files contained in the package, in only two states: normal and missing
-D displays documents in the package (such as MAN,INFO,README, etc.)
-C Displays the configuration files in the package, which are generally required to be manually modified by the user after installation, for example: Sendmail.cf,passwd,inittab, etc.
If you use the-v parameter, you can get output similar to Ls-l

5) Check the package with RPM

1 RPM-VF needs to be validated to the package


RPM Practical Tips!
1) The user can install the package via FTP. If the user is able to connect to the network and wants to install a new package, it can be installed directly with its URL address:
For example: Now there is this file package under ftp.linuxsir.com/pub/linux/redhat/rpms/: foo-1.0-1.i386.rpm, then you can use this command:

To install, you can also query!

2) If the user accidentally deleted a few files, but not sure exactly the files, want to verify the entire system, to understand which parts may have been damaged, can be used:

3) If the user encounters a file that a person does not come out of, want to know that it belongs to that package, you can do this:

The result will be the following information:


4) If the user gets a new rpm file, but does not know its contents, or wants to know that a package will install those files in the system, you can do this:

The results get a lot of information.

This article is referenced from the following articles:

Http://www.cnblogs.com/nuke/archive/2009/03/03/1402067.html

Http://www.jb51.net/LINUXjishu/10984.html

Http://os.51cto.com/art/201001/177866.htm

Http://linux.vbird.org/linux_basic/0520rpm_and_srpm.php#rpmmanager_dir

RPM installation commands for Linux commands

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.