Using RPM

Q. How do you view files in a given package?
A. $ rpm -q –filesbypkg

Ever wonder which package a file is part of? Try this:

/bin/rpm -qf
$ /bin/rpm -qf /usr/bin/whois
jwhois-4.0-19.el6.x86_64

How do you extract files in an RPM without installing the RPM? The below will extract in your ‘pwd’ the files of the RPM.

rpm2cpio rpmname.rpm | cpio -dimv

How do you install Extra Packages for Enterprise Linux (or EPEL) on CentOS 6.x?

sudo wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
sudo vim /etc/yum.repos.d/remi.repo 
Enable the remi repo by changing the 0 to 1 for enabled in remi.

For further reference visit http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s