Team LiB
Previous Section Next Section

Installing, Upgrading, and Deleting Packages

The basic ways of using the rpm command to install, upgrade, and delete packages are covered in many introductory books on Fedora and Red Hat Linux (such as the Red Hat Linux Bible). By way of review, and for troubleshooters who are new to Linux, here are a few basic ways to use the rpm command.

Note 

If the package you want is in a yum or apt repository, I recommend you use the appropriate yum or apt tools to install the package. See Chapter 3 for descriptions of yum and apt.

The most common way to install a new package or upgrade an existing package is by using the -U option of rpm. With the file you want to install in the current directory, type the following:

  # rpm -Uhv packagename-1.1.1.i386.rpm

If the package (represented by packagename-1.1.1.i386.rpm) is not yet installed, this command will install it. If it is a later version of an already installed package, the command will also install it (actually, upgrade it). The -h option prints hash marks (for positive feedback as the package installs) and -v gives verbose output (add multiple v's to see even more verbose output, such as -Uhvvv).

Note 

Instead of -U you can use the -i option to install a package. If it is a package that is not yet installed on your computer, it should install just fine. If the package (or an earlier version) is already installed, the install will fail and you will have to use -U to install it. For installing kernel packages, always use the -i option.

A great option when you are upgrading a whole lot of packages on an existing system is the freshen (-f) option. Let's say that you download a directory of packages with security updates, but you only want to install new versions of packages that are already installed. With that directory as the current directory, you could type the following:

   # rpm -Fvh *.rpm

Packages that are already installed on your computer, but for which there are later versions in the current directory are installed. All other packages in the directory are not installed. (Keep in mind that packages not installed are skipped silently.)

To delete an installed package, use the -e (erase) option to rpm. For example,

  # rpm -e Wnn6-SDK-devel

Again, the deletion of the package is done silently. So if you want positive feedback, add one or more -v options (for example, rpm -evvv).

There are a lot of options to the rpm command that you can use during basic package installs, upgrades, freshens, and deletions. Again, I'd recommend the Red Hat Linux Bible or the rpm man page for details about rpm options. Here are a few options you can use with basic install, upgrade, freshen, and delete options:

Now that you have had a quick review of the basics, the rest of this chapter is devoted to learning how to prevent and track down problems with software packages.


Team LiB
Previous Section Next Section