-->
Page 17
Page 18
Table 2.1. Install-mode command syntax and options.
rpm -i (or --install) | Options | file1.rpm...fileN.rp | |
Parameters | file1.rpm...fileN.rpm | ||
One or more RPM package files (URLs are usable) | Install-Specific Options | ||
Section | -h (or --hash) | ||
Print hash marks (#) during install | 2.3.2 | --test | |
Perform install tests only | 2.4.2 | --percent | |
Print percentages during install | 2.4.11 | --excludedocs | |
Do not install documentation | 2.4.7 | --includedocs | |
Install documentation | 2.4.8 | --replacepkgs | |
Replace a package with a new copy of itself | 2.4.3 | --replacefiles | |
Replace files owned by another package | 2.4.4 | --force | |
Ignore package and file conflicts | 2.4.6 | --noscripts | |
Do not execute pre- and postinstall scripts | 2.4.10 | --prefix <path> | |
Relocate package to <path> if possible | 2.4.9 | --ignorearch | |
Do not verify package architecture | 2.4.17 | --ignoreos | |
Do not verify package operating system | 2.4.18 | --nodeps | |
Do not check dependencies | 2.4.5 | --ftpproxy <host> | |
Use <host> as the FTP proxy | 2.4.16 | --ftpport <port> | |
Use <port> as the FTP port | 2.4.15 | General Options | |
Section | -v | ||
Display additional information | 2.3.1 | -vv | |
Display debugging information | 2.4.1 | --root <path> | |
Set alternate root to <path> | 2.4.13 | --rcfile <rcfile> | |
Set alternate rpmrc file to <rcfile> | 2.4.12 | --dbpath <path> | |
Use <path> to find the RPM database | 2.4.14 |
Of the many things RPM can do, probably the one that users think of first, is the installation of software. As mentioned earlier, installing new software is a complex, error-prone job. RPM turns that process into a single command.
Page 19
rpm -i (--install is equivalent) installs software that's been packaged into an RPM package file. It does this through the following process:
NOTE |
To learn exactly what "the right thing" means, turn to section 4.1.1 in Chapter 4, "Using RPM to Upgrade Packages," for more details. |
Page 20
Let's have RPM install a package. The only thing necessary is to give the command rpm -i, followed by the name of the package file:
# rpm -i eject-1.2-2.i386.rpm #
At this point, all the steps outlined previously have been performed. The package is now installed. Note that the filename need not adhere to RPM's file-naming convention:
# mv eject-1.2-2.i386.rpm baz.txt # rpm -i baz.txt #
In this case, we changed the name of the package file eject-1.2-2.i386.rpm to baz.txt and then proceeded to install the package. The result is identical to the previous install; that is, the eject-1.2-2 package successfully installed. The name of the package file, although normally incorporating the package label, is not used by RPM during the installation process. RPM uses the contents of the package file, which means that even if the file were placed on a DOS floppy and the name truncated, the installation would still proceed normally.
If you've surfed the World Wide Web, you've no doubt noticed the way Web pages are identified. Here's an example:
http://www.redhat.com/support/docs/rpm/RPM-HOWTO/RPM-HOWTO.html
This is called a uniform resource locator, or URL. RPM can also use URLs, although they look a little bit different. Here's one:
ftp://ftp.redhat.com/pub/redhat/code/rpm/rpm-2.3-1.i386.rpm
ftp: signifies that this URL is a File Transfer Protocol URL. As the name implies, this type of URL is used to move files around. The section containing ftp.redhat.com specifies the hostname, or the name of the system where the package file resides.
The remainder of the URL (/pub/redhat/code/rpm/rpm-2.3-1.i386.rpm) specifies the path to the package file, followed by the package file itself.
RPM's use of URLs gives you the ability to install a package located on the other side of the world, with a single command:
# rpm -i ftp://ftp.gnomovision.com/pub/rpms/foobar-1.0-1.i386.rpm #
This command would use anonymous FTP to obtain the foobar version 1.0 package file and install it on your system. Of course, anonymous FTP (no username and password required) is