Firefox 16, a treat for developers http://t.co/cnd27CzT
Tip en Tricks about RPM Commands
Question: How to user RPM command in Redhat , Fedora, Centos, SL (Scientific Linux), Mandriva ..and other rpm based OS. ?
- Install an RPM Package
RPM packages have file naming conventions like abc-2.0-4.i386.rpm, which include the package name (abc), version (2.0), release (4), and architecture (i386). Also notice that RPM understands FTP and HTTP protocols for installing and querying remote RPM files.
rpm -ivh abc-2.0-4.i386.rpm
rpm -i ftp://ftp.redhat.com/pub/redhat/RPMS/abc-1.0-1.i386.rpm
- Un-install an RPM Package
To un-install an RPM package, we use the package name abc, not the name of the original package file abc-2.0-4.i386.rpm above.
rpm -e abc
- Upgrade an RPM Package
To upgrade an RPM package, RPM automatically un-installs the old version of the abc package and installs the new package. It is safe to always use rpm -Uvh to install and upgrade packages, since it works fine even when there are no previous versions of the package installed. Also notice that RPM understands FTP and HTTP protocols for upgrading from remote RPM files.
rpm -Uvh abc-1.0-2.i386.rpm
rpm -Uvh ftp://ftp.redhat.com/pub/redhat/RPMS/abc-1.0-1.i386.rpm
- Query all Installed Packages
Use RPM to print the names of all installed packages installed on your Linux system.
- Query an RPM Package
Querying an RPM package will print the package name, version, and release number of the package abc only if it is installed. Use this command to verify that a package is or is not installed on your Linux system.
rpm -q abc
rpm -qa|grep abc
- Display Package Information
RPM can display package information including the package name, version, and description of the installed program. Use this command to get detailed information about the installed package.
rpm -qi abc
- List Files in Installed Package
The following command will list all of files in an installed RPM package. It works only when the package is already installed on your Linux system.
rpm -ql abc
- Which package owns a file?
Use the following command to determine which installed package a particular file belongs to.
rpm -qf /usr/bin/mysql
# rpm -qf /usr/bin/mysql
- List Files in RPM File
Use RPM to query a (possibly) un-installed RPM file with the use of the the “-p” option. You can use the “-p” option to operate on an RPM file without actually installing anything. This command lists all files in an RPM file you have in the current directory. Also note that RPM can query remote files through the FTP and HTTP protocols.
rpm -qpl kernel-2.4.20-18.10.1.i686.rpm
rpm -qpl ftp://ftp.redhat.com/pub/redhat/RPMS/abc-1.0-1.i386.rpm
- Verify an Installed Package
Use RPM to list all files that do NOT pass the verify tests (done on size, MD5 signature, etc).
rpm --verify mysql
- Where a file does NOT pass, the output is listed using the following codes that signify what failed:
S File size
M Mode (includes permissions and file type)
5 MD5 sum
Take for example the following:
# rpm --verify mysql
S.5....T c /etc/my.cnf
This example indicates that file /etc/my.cnf failed on:
However, the “c” tells us this is a configuration file so that explains the changes. It should still be looked at to determine what the changes were.
Check an RPM Signature Package
RPM can be used to check the PGP signature of specified packages to ensure its integrity and origin. Always use this command first before installing a new RPM package on your system. Also, GnuPG or Pgp software must be already installed on your system before you can use this command.
rpm --checksig abc
If you know more commands, please share them with other readers by commenting the post. Thanks
Like us on Facebook
This week Top Posts
- Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
- Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
- Unix/Linux File Recognition. Did You Know? : Did you know that Unix and Linux has no concept of a file extension? What is a file name extension? ...0 comment(s) |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...1 comment(s) |
- Howto- Resolve nosound problem on Ubuntu 13.04 Raring Ringtail,12.10 and Older : Updated 05/04/2013 : One of the common issues facing Ubuntu users after installing or upgrading Ubun...0 comment(s) |
- Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
- Unix/Linux File Recognition. Did You Know?
- Migrate from MySQL to MariaDB in FreeBSD
- Connect Your Android Galaxy Tablet to Ubuntu via USB
- ElementaryOS Beta 1 and 2 Comparison and Review
- Introduction to the Linux Command Line
- A Secure Password
- Linux Kernel 3.10. It’s BIG!
- Monitoring Users Activity Using psacct or acct Tools in Linux
- Run Your Own Social Network Using elgg on RHEL / CentOS and Scientific Linux
- Getting Debian 7.0 ‘Wheezy’ Up and Running
Copyright © 2008-2013 Unixmen.com .