Install Software Packages and Dependencies for RPM-Based Distributions


yum install [package]

The rpm command is powerful, but after you use it for a while you'll quickly run into a problem when you try to install a package that has dependencies (otherwise known as "dependency hell"). In order to install package A, you also need to download and install packages B and C, but in order to install C you also need to download and install packages D and E, but in order to install E...aaaaaggh!

Debian-based distributions (that you'll read about later in this chapter) solved this problem years ago with the powerful and useful apt; RPM-based distributions can use apt, but more commonly they use the relatively new and still immature yum. Originally developed for the RPM-based Yellow Dog Linux distribution (hence the name, which stands for Yellow Dog Updater, Modified), yum is now widely used but still lags behind apt in features and usability. Still, that's what's available, so that's what we're going to cover.

The yum command installs, upgrades, and uninstalls software packages by acting as a wrapper around rpm. In addition, yum automatically handles dependencies for you. For example, if you're trying to install package A from the example in the introductory paragraph, yum downloads and installs A, B, and C for you. Later, if you decide that you no longer want A on your system, yum can uninstall it for you, along with B and C, as long as other software packages don't require them.

Installing software with yum is pretty easy. Let's say you want to install XMMS, a media player (not surprising, since the name stands for X Multimedia System). To install XMMS, you also need to install several other dependencies. With yum, this process becomes much less painful than it would be if you were attempting to install manually using rpm. To start with, you don't need to find and download the xmms package yourself; instead, yum downloads XMMS and any other necessary dependencies for you.

Unfortunately, yum is incredibly verbose as it goes about its work. The following output has been cut drastically, yet it's still lengthy. Nevertheless, this gives you a rough approximation of what you'd see if you were using yum.

#  yum install xmms Setting up Install Process Setting up repositories update 100% |======================|  951 B     00:00 base   100% |======================| 1.1 kB     00:00 Resolving Dependencies --> Populating transaction set with selected  packages. Please wait. ---> Downloading header for xmms to pack into   transaction set. xmms-1.2.10-9.i386.rpm 100% |==========| 24 kB 00:00 --> Restarting Dependency Resolution with new  changes. ---> Downloading header for gtk+ to pack into   transaction set. gtk%2B-1.2.10-33.i386.rpm 100% |==========|  23 kB  00:00 Dependencies Resolved   Package    Arch Version      Repository      Size Installing:   xmms       i386 1:1.2.10-9   base            1.9 M Installing for dependencies:   libogg     i386 2:1.1.2-1    base             16 k   libvorbis  i386 1:1.1.0-1    base            185 k Total download size: 3.3 M Is this ok [y/N]: 


After you enter y, yum downloads and installs the packages, continuing to inform you about what it's doing, every step of the way.

[View full width]

Downloading Packages: ... (5/6): libogg-1.1.2-1.i38 100% |==========| 16 kB 00:00 (6/6): libvorbis-1.1.0-1. 100% |==========| 185 kB 00:00 Running Transaction Test Running Transaction Installing: libogg ########## [1/6] Installing: libvorbis ########## [2/6] ... Installed: xmms.i386 1:1.2.10-9 Dependency Installed: gdk-pixbuf.i386 1:0.22.0-17.el4.3 gtk+.i386 1:1.2.10-33 libogg.i386 2:1.1.2-1 libvorbis.i386 1:1.1.0-1 mikmod.i386 0:3.1.6-32.EL4


Whew! XMMS is finally installed and available for use. Now find out how to get rid of XMMS if you decide you don't like it.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net