January 2, 2007

RPM Installation Options

RPM Package Manager

RPM is the RPM Package Manager. It is an open packaging system available for anyone to use. It allows users to take source code for new software and package it into source and binary form such that binaries can be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages and their files that can be used for verifying packages and querying for information about files and/or packages.

Red Hat, Inc. encourages other distribution vendors to take the time to look at RPM and use it for their own distributions. RPM is quite flexible and easy to use, though it provides the base for a very extensive system. It is also completely open and available, though we would appreciate bug reports and fixes. Permission is granted to use and distribute RPM royalty free under the GPL.

More complete documentation is available on RPM in the book by Ed Bailey, Maximum RPM. That book is available for download or purchase at www.redhat.com

RPM Requirements

To build RPMs from source, you also need everything normally required to build a package, like gcc, make, etc.

Let's say you delete some files by accident, but you aren't sure what you deleted. If you want to verify your entire system and see what might be missing, you would do:

rpm -Va

Let's say you run across a file that you don't recognize. To find out which package owns it, you would do:

rpm -qf /usr/X11R6/bin/xjewel   

O/P: xjewel-1.6-1

RPM Installation options
  • rpm -i *.rpm -Installs rpm pacakge
  • rpm -iv *.rpm - installs rpm pacakge and shows the output in verbose mode
  • rpm -ivh *.rpm -installs rpm package and shows the output and also the # mark ...
  • rpm -iv --replacefiles *.rpm installs rpm package and replaces the existing rpm files
  • rpm -iv --nodeps *.rpm --nodeps: Do Not Check Dependencies before Installing Package
  • rpm -iv --force *.rpm Adding --force to an install command is a way of saying "Install it anyway!"
  • rpm -vv *.rpm --Getting debugging information .

The rpm -e command (--erase is equivalent) removes, or erases, one or more packages from the system. RPM performs a series of steps whenever it erases a package:

Getting More Information With -vv

rpm -evv eject

rpm -U — What Does it Do?

If there was one RPM command that could win over friends, it would be RPM's upgrade command. After all, anyone who has ever tried to install a newer version of any software knows what a traumatic experience it can be. With RPM, though, this process is reduced to a single command: rpm -U. The rpm -U command (--upgrade is equivalent) performs two distinct operations:

1. Installs the desired package.

2. Erases all older versions of the package, if any exist.

rpm -q — What does it do?

One of the nice things about using RPM is that the packages you manage don't end up going into some kind of black hole. Nothing would be worse than to install, upgrade, and erase several different packages and not have a clue as to what's on your system. In fact, RPM's query function can help you get out of sticky situations like:

* You're poking around your system, and you come across a file that you just can't identify. Where did it come from?

* Your friend sends you a package file, and you have no idea what the package does, what it installs, or where it originally came from.

* You know that you installed XFree86 a couple months ago, but you don't know what version, and you can't find any documentation on it.

The list could go on, but you get the idea. The rpm -q command is what you need. If you're the kind of person that doesn't like to have more options than you know what to do with, rpm -q might look imposing. But fear not. Once you have a handle on the basic structure of an RPM query, it'll be a piece of cake.

No comments: