This week we are diverging from the usual daily themes to present a Focus Week on Package Management.
This site, the Fedora Daily Package, is all about the software packages included in Fedora Core and Fedora Extras. Fedora includes a number of powerful tools for managing packages, and this week will focus on those tools so that you can get the most out of your system.
The Yum repository system is layered on top of RPM to facilitate automatic package downloading and dependency resolution. There are seven ways to access Yum repositories in Fedora 6:
- the yum command
- the pirut graphical installation/removal tool, located on the menus at Applications > Add/Remove Software
- the pup package updater, located on the menus at Applications > System Tools > Software Updater
- the yum-updatesd service, which normally signals the puplet applet in the notification area to inform the user of the availability of updates, but which can also be configured to automatically update packages or download available updates.
- the yum-updateonboot service, which is not installed by default; it automatically updates the system at boot time
- the optional kyum graphical interface for yum (a KDE alternative to Pirut)
- the yumex graphical tool, which is available in Fedora Extras -- this is a very powerful GUI tool, providing access to some yum features that are not accessible through other GUI tools such as pirut and pup
In today's article I will focus on the first three programs:
yum,
pirut, and
pup.
Using Pirut
Pirut (pronounced "pirate") is a tool for graphically installing and removing packages on a Fedora system.
Pirut starts in browse mode, which is one of three modes selected by tabs at the top of the window. This mode displays a list of categories (on the left) and sub-categories (on the right). Selecting a category using the displayed checkbox and then clicking Apply will install the mandatory software for that subcategory; deselecting the checkbox and then clicking Apply will remove the software in that subcategory.
In addition to the mandatory software in each subcategory, there may be optional packages. The Optional Packages button will open a new window with a list of these optional packages, enabling you to select the ones you wish to install.
At the end of each package article on the Fedora Daily Package we
include a line that says "Installing using the graphical installer", which is referring to pirut. The path listed on that line tells you where to find that package in pirut; for example, "Installing using the graphical installer: Desktop Environments > GNOME Destkop Environment > gnotime" indicates that you should select the Desktop Environments category, the GNOME Desktop Environment subcategory, and then select gnotime entry on the Optional Packages list.
The Search and List tabs do what you would reasonably expect them to do: Search lets ou search for a specific string in the package names and summaries, and List presents a sorted list of all individual packages, both installed and uninstalled.
Updating Packages with Pup
Pup is little brother to pirut. It simply updates existing packages; when you run it, you'll see a list of available updates with each one pre-selected by a checkmark. Uncheck any packages which you do not wish to update and then click Apply Updates. Pup will confirm the update with you (including any dependencies) and then install the updated packages.
The yum Command
You can directly access the repository system from the shell using the yum command line. If you're comfortable using the shell (command line), this is usually the fastest way to install and remove packages.
Yum requires an argument that specifies the action to take -- this is known as the yum command. The most commonly-used commands are:
- install
- remove
- update
- list
- search
The
install and
removecommands work exactly as expected: they install or remove the listed packages. You can use wildcards in the package names to specify a group of related packages. Here are some examples:
yum install evolution
yum remove lirc
yum install "totem*"
Yum will determine what other packages must be installed or removed and then present this information to you for confirmation:
# yum remove httpd
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package httpd.i386 0:2.2.3-5 set to be erased
--> Running transaction check
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
--> Processing Dependency: httpd >= 2.2.0 for package: gnome-user-share
--> Processing Dependency: webserver for package: webalizer
--> Processing Dependency: httpd for package: mediawiki
--> Processing Dependency: httpd >= 2.0.40 for package: mod_python
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_perl
--> Processing Dependency: httpd-mmn = 20051115 for package: php
--> Processing Dependency: httpd = 2.2.3-5 for package: httpd-manual
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_python
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_ssl
--> Processing Dependency: httpd = 0:2.2.3-5 for package: mod_ssl
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package mod_python.i386 0:3.2.8-3.1 set to be erased
---> Package httpd-manual.i386 0:2.2.3-5 set to be erased
---> Package gnome-user-share.i386 0:0.10-5 set to be erased
---> Package mod_ssl.i386 1:2.2.3-5 set to be erased
---> Package php.i386 0:5.1.6-3.4.fc6 set to be erased
---> Package webalizer.i386 0:2.01_10-30.1 set to be erased
---> Package mod_perl.i386 0:2.0.2-6.1 set to be erased
---> Package mediawiki.i386 0:1.8.4-8.fc6 set to be erased
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
httpd i386 2.2.3-5 installed 2.8 M
Removing for dependencies:
gnome-user-share i386 0.10-5 installed 89 k
httpd-manual i386 2.2.3-5 installed 3.4 M
mediawiki i386 1.8.4-8.fc6 installed 11 M
mod_perl i386 2.0.2-6.1 installed 6.5 M
mod_python i386 3.2.8-3.1 installed 1.1 M
mod_ssl i386 1:2.2.3-5 installed 173 k
php i386 5.1.6-3.4.fc6 installed 3.1 M
webalizer i386 2.01_10-30.1 installed 251 k
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 9 Package(s)
Is this ok [y/N]: n
Exiting on user Command
Complete!
In this case, removing httpd (Apache) would cause the removal of 9 other packages which depend on it. The user elected to abort after reviewing this information. Note that adding the option -y to the yum command line would skip the confirmation step and proceed directly to installing or removing the requested package(s).
Updating packages with yum is trivial:
yum update # updates all packages
yum update bash # ony updates the bash package
Again, yum will calculate dependencies and then prompt you for confirmation.
The list and search commands both search for packages based on a string; list searches only package names for packages that match a glob pattern (optionally including the * or ? metacharacters), while search also looks for the given string in the package name, summary, description, and packager fields. In both cases it's a good idea to quote the search string, and you can optionally specify one of the keywords available, installed, or updates to select uninstalled packages, installed packages, or installed packages where a newer version exists in the repositories.
For example, this command will list all packages that start with "evolution":
# yum list "evolution*"
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Installed Packages
evolution.i386 2.8.3-2.fc6 installed
evolution-data-server.i386 1.8.3-4.fc6 installed
evolution-data-server-devel.i386 1.8.3-4.fc6 installed
evolution-sharp.i386 0.11.1-10.fc6 installed
evolution-webcal.i386 2.7.1-6 installed
Available Packages
evolution-bogofilter.i386 0.2.0-3.fc6 extras
evolution-connector.i386 2.8.3-1.fc6 updates
evolution-devel.i386 2.8.3-2.fc6 updates
evolution-remove-duplicates.i386 0.0.2-3.fc6 extras
To list all packages that mention "bourne again shell":
# yum search "bourne again shell"
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up repositories
livna 100% |=========================| 1.1 kB 00:00
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
(snip)
bash.i386 3.1-16.1 installed
Matched from:
The GNU Bourne Again shell (bash) version 3.1.
The GNU Bourne Again shell (Bash) is a shell or command language
interpreter that is compatible with the Bourne shell (sh). Bash
incorporates useful features from the Korn shell (ksh) and the C shell
(csh). Most sh scripts can be run by bash without modification. This
package (bash) contains bash version 3.1, which improves POSIX
compliance over previous versions.
Note that the search command may return multiple matches for one package (removed from the example above to save space).
The info command provides a way of viewing package metadata (similar to rpm -qi):
# yum info evolution
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Installed Packages
Name : evolution
Arch : i386
Version: 2.8.3
Release: 2.fc6
Size : 36 M
Repo : installed
Summary: GNOME's next-generation groupware suite
Description:
Evolution is the GNOME mailer, calendar, contact manager and
communications tool. The tools which make up Evolution will
be tightly integrated with one another and act as a seamless
personal information-management tool.
Tomorrow we'll look at enabling and disabling repositories, using a Fedora DVD as a repository, and some important yum plugins.
Over the next few days we'll continue to examine the Fedora package tools in detail:
- Thursday - Enabling and disabling repositories and using yum plugins.
- Friday - Package management tips and tricks.
And in case you missed them:
- Monday - RPM Basics
- Tuesday - Using the rpm command to query the package database as well as install, update, and remove packages.