User Tools

Site Tools


rpm

This is an old revision of the document!


RPM tips

Check if a package is installed:

$ rpm -qa | grep core
openoffice.org-core-2.3.0-6.10.el5
coreutils-5.97-19.el5
policycoreutils-1.33.12-14.2.el5

List files in a certain package:

$ rpm -ql coreutils

List files in an RPM:

$ rpm -qlp apcupsd-3.14.7-1.x86_64.rpm

Manually install an rpm (as in, not using a repository with a package manager like yum):

$ sudo rpm -i VirtualBox-3.0.6_52128_rhel5-1.x86_64.rpm

Manually remove an rpm:

$ sudo rpm -e VirtualBox

upgrade a package

rpm -Uvh <package>
  • rpm -qa | less :list all installed software packages
  • rpm -q httpd :show the version of the httpd package, if it is installed
  • rpm -qa | grep httpd : show all installed packages that have httpd in their name
  • rpm -ql httpd : list all files in the httpd package
  • rpm -qd httpd : list all documentation files in the httpd package
  • rpm -qc httpd : list all configuration files in the httpd package
  • rpm -qi httpd : display information about the package
  • rpm -V httpd : verify that the httpd package is correctly installed
  • rpm -qf /etc/passwd :determine which package the /etc/passwd file belongs to

To unistall a package, check first the exact name of the package,

  • yum -y install curl # -y answers "yes" to all questions
rpm -e <package name>
rpm -qa | grep -i <packagename>

Custom RPMs

And RPM is a pre-compiled package containing binaries and config files, etc which can be installed using rpm or yum command line tools. An SRPM or "source RPM" contains everything you need to rebuild a package. Sometimes a binary RPM is not available, you can build a custom RPM using the following process:

First, setup your home directory for building RPMs:

$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
  • Download an SRPM (which contains everything you need to build the package)
  • Build with: rpmbuild –rebuild EMBOSS-5.0.0-1.src.rpm
  • Install with sudo rpm -i
rpm.1259057194.txt.gz · Last modified: 2010/05/22 14:19 (external edit)