4. Using RPM

Contents of this section

In its simplest form, RPM can be used to install packages:

        rpm -i foobar-1.0-1.i386.rpm
The next simplest command is to uninstall a package:
        rpm -u foobar

One of the more complex but highly useful commands allows you to install packages via FTP. If you are connected to the net and want to install a new package, all you need to do is specify the file with a valid URL, like so:

        rpm -i ftp://ftp.pht.com/pub/linux/redhat/rh-2.0-beta/RPMS/foobar-1.0-1.i386.rpm

Please note, however, that the current version of RPM will only do installs via FTP. You cannot run any of the more complex query options on packages at an FTP site.

While these are simple commands, rpm can be used in a multitude of ways as seen from the Usage message:

rpm version 1.4.5
Copyright (C) 1995 - Red Hat Software
This may be freely redistributed under the terms of the GNU Public License

usage: rpm {--help}
       rpm {--version}
       rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]
                          [--search] [--root <dir>] file1.rpm ... filen.rpm
       rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]
                          [--search] [--root <dir>] file1.rpm ... fileN.rpm
       rpm {--query -q} [-afFpP] [-i] [-l] [-s] [-d] [-c] [-v] 
                        [--root <dir>] [targets]
       rpm {--verify -V -y] [-afFpP] [--root <dir>] [targets]
       rpm {--uninstall -u] [--root <dir>] package1 package2 ... packageN
       rpm {-b}[plciba] [-v] [--short-circuit] [--clean] [--keep-temps]
                        [--test] [--time-check <s>] specfile
       rpm {--rebuild} [-v] source1.rpm source2.rpm ... sourceN.rpm
       rpm {--where} package1 package2 ... packageN

First, I'll go through a synopsis of what all the options mean (don't worry, there may be alot of options, but we tried to make them all as intuitive as possible).

Options are nested, so the possible options are many. Here's a description in parallel with the Usage message:


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter