Home arrow Site Administration arrow Page 2 - Linux Administration: Installing Software

Installing a New Package - Administration

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

  1. Linux Administration: Installing Software
  2. Installing a New Package
  3. Uninstalling a Package
  4. Compile and Install GNU Software
  5. Looking for Documentation
  6. Installing the Package and Testing the Software
  7. Common Software Problems
  8. Cleanup and When There is No Configure Script
  9. Compiling and Installing a GNU Program
  10. Project Summary
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 32
November 02, 2004

print this article



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.

Command-Line OptionDescription
--forceThis 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.
-hPrints 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.

-nodepsIf 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.
-qQueries the RPM system for information.
--testThis 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.
-VVerifies RPMs or files on the system.
-vTells RPM to be verbose about its actions.

Table 1  RPM Command-Line Options

For example, to force the installation of a package regardless of dependencies or other errors, you would type:

[root@ford /root]# rpm -i --force -nodeps packagename.rpm

where packagename.rpm is the name of the package being installed.

Querying a Package

Sometimes it is handy to know which packages are currently installed and what they do. You can do that with the RPM query options.

To list all installed packages, simply type:

[root@ford /root]# rpm -qa

Be ready for a long list of packages! If you are looking for a particular package name, you can use the grep command to specify the name (or part of the name) of the package, like so:

[root@ford /root]# rpm -qa | grep -i ' name'

NOTE  The -i parameter in grep tells it to make its search case-insensitive.

If you just want to view all of the packages one screen at a time, you can use the more command, like so:

[root@ford /root]# rpm -qa | more

To find out which package a particular file belongs to, type:

[root@ford /root]# rpm -qf filename

where filename is the name of the file that you want to check on.

To find out the purpose of a package that is already installed, you must first know the name of the package (taken from the listing in rpm -qa) and then specify it, like so:

[root@ford /root]# rpm -qi packagename

where packagename is the name of the package that you want information about.

To find out what files are contained in a package, type:

[root@ford /root]# rpm -qlp packagename

where packagename is the name of the package that you want information about.

This chapter is from Linux Administration, A Beginner's Guide, third edition, by Graham and Shah. (McGraw-Hill/Osborne, 2002, ISBN: 0072225629). Check it out at your favorite bookstore today.

Buy this book now.

>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: