Three basic software installations are covered here -- using the Red Hat Package Manager, compiling software using the standard GNU compilation method, and compiling and installing the software by hand. (From the book Linux Administration, A Beginner's Guide, third edition by Steven Graham and Steve Shah, McGraw-Hill/Osborne, 0072225629, 2002).
The easiest way to install a new package is to use the -i option with RPM. For example, if you downloaded a package called bc-1.05a-4.i386.rpm and wanted to install it, you would type:
[root@ford /root]# rpm -ivh bc-1.05a-4.i386.rpm
If the installation went fine, you would not see any errors or messages. This is the most common method of installing RPMs. On the other hand, if the package already exists, you would see this message:
error: package bc-1.05a-4 is already installed
Some packages rely on other packages. A game, for example, may depend on SVGA libraries having already been installed. In those instances, you will get a message indicating which packages need to be installed first. Simply install those packages and then come back to the original package.
If you need to upgrade a package that already exists, use the -U option, like so:
[root@ford /root]# rpm -Uv bc-1.05a-4.i386.rpm
Some additional command-line options to RPM are listed in Table 1.
This is the sledgehammer of installation. Typically, you use it when you’re knowingly installing an odd or unusual configuration, and RPM’s safeguards are trying to keep you from doing so. The --force option tells RPM to forego any sanity checks and just do it, even if it thinks you’re trying to fit a square peg into a round hole. Be careful with this option.
Prints hash marks to indicate progress during an installation. Use with the -v option for a pretty display.
Prints the percentage completed to indicate progress. It is handy if you’re running RPM from another program, such as a Perl script, and you want to know the status of the install.
If RPM is complaining about missing dependency files, but you want the installation to happen anyway, passing this option at the command line will cause RPM to not perform any dependency checks.
Queries the RPM system for information.
This option does not perform a real installation; it just checks to see whether an installation would succeed. If it anticipates problems, it displays what they’ll be.
Verifies RPMs or files on the system.
Tells RPM to be verbose about its actions.
Table 1RPM Command-Line Options
For example, to force the installation of a package regardless of dependencies or other errors, you would type: