Software Installation and Maintenance
◾
541
Yum is also handy for upgrading software without your involvement. Whereas in RPM,
to upgrade a package you would
have to initiate the request, you can schedule yum to
regularly search for upgrades and install them without your interaction. We examine this
use of yum in Section 13.5.
The yum program does not require a file already downloaded to perform its task unlike
rpm (although rpm
could download the file first, if a URL is provided in place of a file
name). With yum, instead, it searches prespecified repositories and mirror sites for the
package named in the instruction. The yum instruction essentially has three parts:
• The command: install, update, remove, list
• The package name: this is not a
file name, but a less specific software title such as gcc
(the C compiler), emacs, httpd (the Apache web server)
• Options
For example, you might issue the command
yum install emacs
or
yum
update httpd
The
list
command does not require a package name at all. If one is provided, you
will be given all packages that match that name. Wildcard characters of * and [] can be
included with the package name so that globbing takes place. Two examples follow:
yum list *gnome*
yum list gimp[0-9]
The first of these will list any packages that contains “gnome” in the title. The second will
list any packages starting with the characters “gimp” followed by a digit.
Aside
from install, update, remove, and list, there are dozens of other possible com-
mands. Table 13.2 highlights a few of the more common commands. The additional
parameters are typically either package names or filenames. As with install and list, these
can include wildcards.
yum has a number of options although only a few are worth mentioning. First, the
option -y (or --assumeyes) will respond ‘y’ to any “yes/no” question that yum asks. This
allows yum to run without any user interaction. The options -d and -e
set debug and
error levels to control output. Other options control aspects of the installation such as
--
installroot
=
dir
to alter the installation location to
dir
as opposed to the default and
--
enablerepo
=
repos
and --
disablerepor
=
repos
to
enable and disable specific
repositories to be or from being accessed for installation.
542
◾
Linux with Operating System Concepts
Let us take a look at the output from yum. Here, we issue the command
yum –y install emacs
This command will find the emacs package in one of the repositories
and begin installation
without waiting for the user because of the –y option. The output provided is shown below
with comments interspersed to explain what is going on.
Loaded plugins: fastestmirror, refresh-packagekit,
security
Loading mirror speeds from cached hostfile
* base: ftp.linux.ncsu.edu
* extras: mirror.serversurgeon.com
* updates: mirror.linux.duke.edu
TABLE 13.2
Yum Commands
Do'stlaringiz bilan baham: