esac
}
Displaymonth 8
The preceding program displays the following output:
Month is August
Reference
► http://www.gnu.org/software/bash/bash.html — The bash home page at the GNU Software Project.
► http://www.tldp.org/LDP/abs/html/ — Mendel Cooper's "Advanced Bash-Scripting Guide."
► http://www.linuxnewbie.org/nhf/intel/shells/basic.html — Learn basic shell commands at this site.
► http://www.cs.princeton.edu/~jlk/lj/ — "The New Korn Shell — ksh93," an article by David G. Korn, Charles J. Northrup, and Jeffery Korn regarding the korn shell.
► http://lug.umbc.edu/~mabzug1/bash-httpd.html — The Bash-httpd FAQ, with links to the latest version of the bash web server, bash-httpd-0.02.
► http://www.tcsh.org/ — Find out more about tcsh here.
► http://www.zsh.org/ — Examine zsh in more detail here.
CHAPTER 34
Advanced Software Management
Fedora is provided with a large number of packages already supplied and ready to go. However, Fedora also comes with a great package management tool, called yum, which enables you to quickly and easily download and install more packages. The yum tool (Yellowdog Updater, Modified) has been included with Fedora since version 1 and has become the tool of choice for installing and updating applications. This chapter takes a look at how yum works, its basic usage, and more advanced package and repository management, including using some of the GUI tools available with Fedora. But before that, we take a look at RPM, which is the underlying technology that yum utilizes.
Using RPM for Software Management
The rpm command uses the RPM system to install, remove (erase), upgrade, verify, and build software archives known as RPM files. These archives, or packages, contain package identification (a signature), checksums (mathematically derived validation values), and an archive of the software, either in source or binary form. An RPM package also contains quite a bit of additional information, such as a name, version, and basic description, and can include pre- and post-installation scripts used for software installation, erasure, or upgrading.
RPM has a long history and is closely associated with Red Hat, the sponsors of Fedora. RPM itself can link itself back to early Linux package management software — named RPP PMS, and PM — that were written in Perl. RPM came onto the scene in Red Hat Linux 2.0, released late 1995, and was then rewritten in C for the Red Hat Linux 3.0.3 (Picasso) release in 1996. Since then, the rpm command has been the prime feature of Red Hat's unique software management system, which is based on the concept of pristine sources, or the capability to use a single, initial archive of a program's source code to build packages for different systems and to track versions.
In addition to improving the package management of early software management scripts, RPM version 4.1 introduced software features designed to ease the task of building software for different platforms from a single set of source-code files. Changes can be tracked and kept outside a developer's initial source code, and multiple packages can be built from scratch and installed at the same time. Simultaneously, RPM also verifies installation dependencies. Additional features, such as a checksum and GNU Privacy Guard (GPG) signatures, enable binary software pack ages to be safely distributed without the fear of virus infection or the inclusion of Trojan code. Red Hat has committed to further active development of RPM.
The RPM database installed on your computer keeps track of which versions of which packages are installed. RPM uses your system's /var/lib/rpm directory to store files (actually databases) containing information about the software installed on your system. You can use the ls command to view these files. (You might see file sizes different from those shown here, depending on the amount of software you have installed.)
total 75476
-rw-r--r-- 1 root root 10432512 2007-10-29 21:36 Basenames
-rw-r--r-- 1 root root 12288 2007-10-29 21:17 Conflictname
-rw-r--r-- 1 root root 0 2007-10-29 21:17 __db.000
-rw-r--r-- 1 root root 24576 2007-10-29 21:15 __db.001
-rw-r--r-- 1 root root 1318912 2007-10-29 21:15 __db.002
-rw-r--r-- 1 root root 450560 2007-10-29 21:15 __db.003
-rw-r--r-- 1 root root 3145728 2007-10-29 21:36 Dirnames
-rw-r--r-- 1 root root 10584064 2007-10-29 21:36 Filemd5s
-rw-r--r-- 1 root root 32768 2007-10-29 21:36 Group
-rw-r--r-- 1 root root 20480 2007-10-29 21:36 Installtid
-rw-r--r-- 1 root root 86016 2007-10-29 21:36 Name
-rw-r--r-- 1 root root 54706176 2007-10-29 21:36 Packages
-rw-r--r-- 1 root root 344064 2007-10-29 21:36 Providename
-rw-r--r-- 1 root root 131072 2007-10-29 21:36 Provideversion
-rw-r--r-- 1 root root 12288 2007-10-29 21:17 Pubkeys
-rw-r--r-- 1 root root 479232 2007-10-29 21:36 Requirename
-rw-r--r-- 1 root root 278528 2007-10-29 21:36 Requireversion
-rw-r--r-- 1 root root 163840 2007-10-29 21:36 Sha1header
-rw-r--r-- 1 root root 81920 2007-10-29 21:36 Sigmd5
-rw-r--r-- 1 root root 12288 2007-10-29 21:36 Triggername
The primary database of installed software is contained in the file named Packages. As you can see from the preceding example, this database can grow to 50MB (and perhaps larger) if you perform a full installation of Fedora (more than 4GB of software). After you install Fedora, rpm and related commands use this directory during software management operations.
rpm at the Command Line
As a Fedora system administrator, you will use the rpm command or the Fedora graphical clients to perform one of five basic tasks. These operations, which must be conducted by the root operator, include the following:
► Installing new software
► Erasing or removing outdated or unneeded packages
► Upgrading an installed software package
► Querying to get information about a software package
► Verifying the installation or integrity of a package installation
The rpm command has more than 60 command-line options, but its administrative functions can be grouped according to the previous five types of action. Graphical RPM clients provide easy-to-use interfaces to these operations. As a system administrator, you have a choice between using a graphical interface and using rpm's various command-line options.
The general format of an rpm command is as follows:
# rpm option packagename