Linux command rpm installation command, linux command rpm

Source: Internet
Author: User

Linux command rpm installation command, linux command rpm

In Linux, almost all software is installed, uninstalled, and managed through RPM. RPM is called Redhat Package Manager. It is a software developed by Redhat to manage software packages in Linux. During Linux installation, almost all modules except several core modules are installed through RPM. RPM has five operation modes:Installation, uninstallation, upgrade, query and Verification.

1) run the following command to install the software package with RPM:

1 # rpm-I example. rpm installation example. rpm package; 2 # rpm-iv example. rpm installation example. the rpm package displays information about the files being installed during the installation process. 3 # rpm-ivh example. rpm installation example. the rpm package displays the information about the files being installed and the installation progress.


2) Delete installed software packages
To uninstall the Software Package example, enter the following command:

1 # rpm -e example

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

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

1 # rpm -Uvh example.rpm

Note that the rpm will automatically uninstall the old version of the corresponding software package. If the configuration file of the old software version is incompatible with the new version, rpm automatically saves it as another file, and the user will see the following information:

saving /etc/example.conf as /etc/example.conf.rpmsave

In this way, you can manually change the corresponding configuration file.
In addition, if you want to install the old version of the software, you will see the following error message:

# rpm -Uvh example.rpmexamle packag example-2.0-l(which is newer) is already installederror:example.rpm cannot be installed

 

Use the-oldpackage parameter if you want to forcibly install it.

4) query the Software Package
You can use rpm-q to query the corresponding software in the rpm database. rpm will give the software package name, version, and release version number, for example:

1 # rpm -q example

The following are specific parameters that can be used for query:
-A: Query all software packages installed by the system.
-F file name: query the software packages that contain the file.
-F: Same as the-f parameter, but the input is a standard input (for example, find/usr/bin | rpm-qF)
-Q: The software package name.
-Q: Same as the-p parameter, but the input is standard (for example, find/mnt/cdrom/RedHat/RPMS | rpm-qQ)
The output format is as follows:
-I: displays the software package name, description, release, size, compilation date, installation date, and developer information.
-L display the files contained in the Software Package
-S: displays the current status of the file contained in the package. There are only two statuses: normal and missing.
-D: displays the documents in the software package (such as man, info, and README)
-C: displays the configuration files in the software package. These files must be manually modified after installation, such as sendmail. cf, passwd, and inittab.
If the-v parameter is used, the output similar to ls-l can be obtained.

5) Verify the software package with rpm

1 rpm-Vf needs to be verified to the package

 


Rpm practical skills!
1) you can install the software package through FTP. If you can connect to the network and want to install a new software package, you can directly use its URL to install it:
For example:

1 # rpm -i ftp.linuxsir.com/pub/linux/redhat/RPMS/foo-1.0-1.i386.rpm 

 

For installation, you can also query!

2) If the user accidentally deletes several files but is not sure about the files, he wants to verify the entire system to find out which parts may be damaged. You can use:

1 # rpm -Va 

 

3) if the user encounters a file that does not come out and wants to know which package it belongs to, he can do the following:

1 # rpm -qf /usr/X11R6/bin/xjewel 

 

The following information is displayed:

xjewel-1.6-1 


4) if you get a new RPM file but do not know its content, or want to know which files will be installed in the system in a file package, you can do this:

1 # rpm -qpi koules-1.2-2.i386.rpm 

The results will get a lot of information.

 

This article is based on 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

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.