Pick a Free OS

RPM usage for newbies

RPM stands for Red Hat Packet Manger. The traditional way to install a

package was to take an archive and then just extract the files off it into

the required directories. This worked fine but then the administrator

faced a problem when it came to updating the packages. He must locate the

files from the previous install and then make sure they are removed from

the system. RPM helps here. It is a easier and more flexible way of

installation and maintainence of packages. Upgrades are easy. RPM

maintains a database of the packages installed on your system as well as

the locations of the files and the version numbers. Anytime you install a

package in rpm format, RPM will check to see whether there are any files

are in conflict between the packages installed and the packages being

installed. It will also tell you whether any other packages need to be

installed for the software to work. All in all RPM makes life a lot

easier.

RPM has become really popular and several distributions are now based on

it. Red Hat, SuSE, Mandrake, Caldera -- all use the rpm format to maintain

the system software.

Installation of an RPM

RPM installation, updation and removal will have to be done as root.

Querying the database does not require you to be root.

A basic installation of an RPM file can be accomplished by

rpm -ivh

e.g - rpm -ivh foo-1.03.rpm

At this point rpm will go out and check whether the files required by foo

are installed on the system or not. If some other package needs to be

installed then it will inform you of the requirements and exit. If some

files from the package have been installed by some other package then you

will be notified of that also.

Multiple files can also be specified using wildcards so the following is

also legal.

rpm -ivh foo*.rpm

Let's look at the options specified.

-i = Specifies installation as the action to be taken.

-v = Will display additional information while installing.

-h = Prints 50 hash marks (#) as installation progresses.

You can get by with just -i but it is generally a good idea to specify -v

and -h too so that you get proper feedback.

Other options that may be given are

--replacepkgs = Sometimes you may need to re-install a package that has

been damaged then you need to specify this option. If you try a

installation then rpm will say that the package is already installed.