Linux RPM Package Installation upgrade Uninstall query

Source: Internet
Author: User
Tags gpg

RPM is the abbreviation for "Redhat package Manager", which can be guessed by name as Redhat company developed. RPM is a set of management programs that installs the packages you need into your Linux hosts in a database-logged way. In other words, there is a database on RPM in your Linux system that records the installed packages and dependencies between packages and packages. RPM packages are pre-compiled and packaged files on Linux machines that are fast to install. However, there are some shortcomings, such as the installation of the environment must be consistent with the environment or equivalent, the package and the package is dependent on the situation, the package needs to unload the dependencies, if the dependent package is required by the system, you can not unload the package, otherwise it will cause the system to crash.

If you have a system installation disk in your optical drive, we can mount the optical drive to the/MNT directory via the Mount /dev/cdrom /mnt command, then you will be in the/mnt/ See a lot of. rpm files under the packages directory, this is the RPM package.

[[email protected] ~]# mount /dev/cdrom /mnt/mount: block device /dev/ sr0 is write-protected, mounting read-only[[email protected] ~]# ls / mnt/centos_buildtag  packages                     RPM-GPG-KEY-CentOS-Security-6EULA              RELEASE-NOTES-en-US.html     rpm-gpg-key-centos-testing-6gpl               repodata                     trans. tblimages           rpm-gpg-key-centos-6isolinux          rpm-gpg-key-centos-debug-6[[email protected] ~]# ls /mnt/packages/| head389-ds-base-1.2.11.15-11.el6.i686.rpm389-ds-base-libs-1.2.11.15-11.el6.i686.rpmabrt-2.0.8-15.el6.centos.i686.rpmabrt- Addon-ccpp-2.0.8-15.el6.centos.i686.rpmabrt-addon-kerneloops-2.0.8-15.el6.centos.i686.rpmabrt-addon-python-2.0.8-15.el6.c Entos.i686.rpmabrt-cli-2.0.8-15.el6.centos.i686.rpmabrt-desktop-2.0.8-15.el6.centos.i686.rpmabrt-gui-2.0.8-15.el6.centos . i686.rpmabrt-libs-2.0.8-15.el6.centos.i686.rpm

The name of each RPM package is divided into several parts by - and . Take "abrt-cli-2.0.8-15.el6.centos.i686.rpm" this package to explain, "ABRT-CLI" for the package name, "2.0.8" is the version information, "15.el6.centos" for the release version number, "i686" To run the platform. Among the common running platforms are i386, i586, i686, x86_64, which require you to note that the CPU is currently divided into 32-bit and 64-bit, i386,i586 and i686 are 32-bit platforms, and x86_64 represents 64-bit platforms. In addition, some RPM packages do not write specific platforms but Noarch, which means that the RPM package does not have a hardware platform limit. For example, "alacarte-0.10.0-1.fc6.noarch.rpm". Here are some common commands for RPM.

    1. Install a RPM package

[Email protected] ~]# rpm-ivh/mnt/packages/libjpeg-turbo-devel-1.2.1-1.el6.i686.rpmpreparing ... ######## ################################### [100%] 1:libjpeg-turbo-devel ########################################### [100% ]

"-I": Installation meaning

"-V": visualize

"-H": Displays the installation progress

Additional parameters that are commonly used when installing an RPM package are:

--force : Mandatory installation, even if overwriting files belonging to other packages is installed

--nodeps : Install this package when the RPM package to be installed depends on other packages, even if no other packages are installed

    1. Upgrade a RPM Package

Command rpm -uvh filename

"-U": Meaning of the upgrade

    1. Uninstalling an RPM package

Command rpm - e filename

The filename here is queried by the RPM query function and will be introduced later.

[Email protected] ~]# Rpm-qa |grep libjpeg-turbo-devellibjpeg-turbo-devel-1.2.1-1.el6.i686[[email protected] ~]# RPM- E Libjpeg-turbo-devel

There is a difference between the filename and the installation at the time of uninstallation, the installation is to use an existing file as a parameter, and only the package name when uninstalling.

    1. Query whether a package is installed

Command rpm - q RPM package name (here the package name, is not with the platform information and suffix name)

[Email protected] ~]# rpm-q libjpeg-turbo-develpackage libjpeg-turbo-devel are not installed[[email protected] ~]# rpm-i Vh/mnt/packages/libjpeg-turbo-devel-1.2.1-1.el6.i686.rpmpreparing ... ##################################### ###### [100%] 1:libjpeg-turbo-devel ########################################### [100%][[email protected] ~]# rpm-q L ibjpeg-turbo-devellibjpeg-turbo-devel-1.2.1-1.el6.i686

We can use the rpm -qa to query the current system for all installed RPM packages, limited to space, Amin only the first 10 listed.

[Email protected] ~]# Rpm-qa | Headplymouth-core-libs-0.8.3-27.el6.centos.i686xml-common-0.6.3-32.el6.noarchsgpio-1.2.0.10-5.el6.i686iso-codes-3.16-2.el 6. Noarchgnome-vfs2-2.24.2-6.el6.i686libx11-common-1.5.0-4.el6.noarchcurl-7.19.7-35.el6.i686ca-certificates-2010.63-3.el6 _1.5.noarchcups-libs-1.4.2-48.el6_3.3.i686kbd-misc-1.15-11.el6.noarch
    1. Get information about an installed RPM package

Command rpm -qi package name (also does not need to add platform information and suffix name)

[[email protected] ~]# rpm -qi libjpeg-turbo-develname         : libjpeg-turbo-devel           relocations:  (not relocatable) version     : 1.2.1                               vendor: centosrelease     :  1.el6                          build date: 2013 February 22   Friday   06:49 08 sec install date: 2013 May 13   Monday  01 37 minutes 48 seconds       build  host: c6b9.bsys.dev.centos.orggroup       : development/ Libraries         source rpm: libjpeg-turbo-1.2.1-1.el6.src.rpmsize         : 321085                            License:  wxwidgetssignature   : rsa/sha1, 2013 February 24   Sunday  01 53 minutes, 55 seconds, key  id 0946fca2c105b9depackager    : centos buildsystem 
 
 
    1. List A RPM package installation file

Command rpm -ql Package name

[Email protected] ~]# RPM-QL libjpeg-turbo-devel/usr/include/jconfig.h/usr/include/jerror.h/usr/include/ jmorecfg.h/usr/include/jpeglib.h/usr/lib/libjpeg.so/usr/share/doc/libjpeg-turbo-devel-1.2.1/usr/share/doc/ libjpeg-turbo-devel-1.2.1/coderules.txt/usr/share/doc/libjpeg-turbo-devel-1.2.1/example.c/usr/share/doc/ libjpeg-turbo-devel-1.2.1/jconfig.txt/usr/share/doc/libjpeg-turbo-devel-1.2.1/libjpeg.txt/usr/share/doc/ Libjpeg-turbo-devel-1.2.1/structure.txt

The above command shows that the file "/usr/lib/libjpeg.so" is obtained by installing the "Libjpeg-turbo-devel" RPM package. So, in turn, how to find a file to be installed by which RPM package is obtained?

    1. List which rpm package a file belongs to

Absolute path to the command rpm -qf file

[Email protected] ~]# rpm-qf/usr/lib/libjpeg.solibjpeg-turbo-devel-1.2.1-1.el6.i686


This article is from "Linux rookie" blog, please be sure to keep this source http://490617581.blog.51cto.com/11186315/1757810

Linux RPM Package Installation upgrade Uninstall query

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.