Friday, December 26, 2008

RPM PACKAGE MANAGER

The Red Hat Package Manager (RPM) allows the easy installation and removal of software packages—typically, precompiled software. A package consists of an archive of files and other metadata.

It is wonderfully easy to use, and several graphical interfaces have been built around it to make it even easier. Several Linux distributions (distros) and various third parties use this tool to distribute and package their software. In fact, almost all of the software mentioned in this book is available in RPM form. The reason you’ll go through the process of compiling software yourself in other chapters is so that you can customize the software to your system, as such customizations might not be readily possible in an RPM.

An RPM file is a package that contains files needed for the software to function correctly. These files can be configuration files, binaries, and even pre- and postscripts to run while installing the software. However, adhering to the open source principle, the various commercial and noncommercial Linux distros are obliged to make the source code for most GNU binaries available. (Those who don’t make it available by default are obliged to give it to you if you ask for it.) Some Linux vendors stick to this principle more than others. Several Linux vendors, therefore, make the source code for their binaries available in RPM form. For instance, Fedora and SuSE also make source code available as an RPM, and it is becoming increasingly common to download and compile source code in this fashion.

The RPM tool performs the installation and uninstallation of RPMs. The tool also maintains a central database of what RPMs you have installed, where they are installed, when they were installed, and other information about the package.

In general, software that comes in the form of an RPM is less work to install and maintain than software that needs to be compiled. The trade-off is that by using an RPM, you accept the default parameters supplied in the RPM. In most cases, these defaults are acceptable. However, if you need to be more intimately aware of what is going on with a piece of software, you may find that by compiling the source yourself, you will learn more about what software components and options exist and how they work together.

Assuming that all you want to do is install a simple package, RPM is perfect. There are several great resources for RPM packages, including the following:
• http://rpm.pbone.net
• http://ftp.redhat.com
• http://mirrors.kernel.org
• http://freshrpms.net

Of course, if you are interested in more details about RPM itself, you can visit the RPM web site at www.rpm.org. RPM comes with Fedora, OpenSuSE, Mandrake, and countless other Red Hat derivatives, and, most surprising of all, the Red Hat version of Linux! If you aren’t sure if RPM comes with your distribution, check with your vendor.

The primary functions of the RPM are
• Querying, installing, and uninstalling software
• Maintaining a database that stores various items of information about the packages
• Packaging other software into an RPM form

Frequently used RPM options
--install. This installs a new package.

--upgrade. This upgrades or installs the package currently installed to a newer version.

--erase. Removes or erases an installed package.

--query. This is the option used for querying.

--force. 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.

-h. Prints hash marks to indicate progress during an installation. Use with the -v option for a pretty display.

--percent. 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.
-nodeps. 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.

-q. Queries the RPM system for information.

--test. 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.

-V. Verifies RPMs or files on the system.

-v. Tells RPM to be verbose about its actions.

Source of Information : McGraw Hill Osborne Media Linux Administration A Beginners Guide Fifth Edition

No comments: