Dec 6, 2012

How to query, install, upgrade or remove RPM in linux ?

Here we are first removing an existing rpm and installing the latest version.
For any of the action you should be either root or in the sudoers list.

To query for rpm
[root@system1 share]# rpm -qa | grep cmake cmake-2.6.4-5.el6.x86_64
To erase rpm
[root@system1 share]# rpm -e cmake-2.6.4-5.el6.x86_64
           [root@system1 share]# rpm -qa | grep cmake .
           [root@system1 share]#

To install rpm

           [root@system1 share]# rpm -i cmake-2.8.8-1.el6.rfx.x86_64.rpm
           warning: cmake-2.8.8-1.el6.rfx.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
           [root@system1 share]# rpm -qa | grep cmake cmake-2.8.8-1.el6.rfx.x86_64
           [root@system1 share]#
or


remove it using yum


            [root@system1 share]# yum remove