Section 6.2. Keeping Software Up to Date


6.2. Keeping Software Up to Date

By now, you would almost certainly have noticed the small flashing exclamation mark icon in the top right corner of the Fedora desktop. Clicking this icon will launch the Red Hat Network Alert Notification Tool shown in Figure 6-14. This tool is designed to keep the RPM packages you've installed up to date.

Unfortunately, this applet, and its companion application up2date , contain a serious bug, so most of their functionality doesn't work. Hopefully, someone at Red Hat or a member of the Fedora community will fix it soon; you can check the status of this bug at Red Hat's Bugzilla bug-tracking system.

If you proceed through the dialogs presented by accepting the Terms of Service and configuring any HTTP Proxies you may use, you'll see the Red Hat Alert Notification icon turn green, to indicate that it's checking for updates, and then turn blue, to indicate that there are no updates available, as shown in Figure 6-15. Unfortunately, this color change is likely to be a symptom of the bug mentioned previously. To make sure no updates are available, you can use Fedora's command-line updating tool, yum . Keep an eye out for this bug to be fixed in a future release of Fedora Core.

Figure 6-14. Red Hat Network Alert Notification Tool displaying on first launch.


Figure 6-15. The Red Hat Network Alert notifier.


6.2.1. yum

yum (Yellow Dog Updater, Modified) is a relatively recent addition to the administration toolkit in many Linux distributions. Derived from a tool that was built for the PowerPC-based Yellow Dog Linux distribution, yum provides a way to keep your system packages up to date by utilizing a network of servers that host RPM packages. We used this tool in Chapter 5 to get the latest version of Apache. yum has some distinct advantages over other tools. These advantages make it a good choice for administratorsespecially those who may not always be sitting at the server.

  • The yum daemon (yumd) can be run in the background to check the repositories periodically for new software updates.

  • yum can also run non-interactively: a simple command line switch will assume that your answer to each yum prompt is "yes."

  • yum uses only RPM package headers to check the system software against the repository. This sets it apart from other updating systems, which create an index in addition to the headers stored in the RPM database. Using only the headers can save considerable disk space on the server, especially as the set of installed tools grows.

  • The yum command set is very small, yet very powerful.


Tip: While yum is a convenient tool, it can occasionally cause problems. For example, some MySQL updates may overwrite your configuration and, sometimes, even delete your data. If your installation depends on specific libraries in order to function, it's generally a good idea to check through the list manually before you install new packages.
6.2.2.1. Updating your Server with yum

To check the availability of updates to your server, enter yum check-update in a terminal window.

[kermit@swinetrek ~]$ su Password: [root@swinetrek kermit]# yum check-update Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 342 kB   00:09 updates-re: ############################################ 954/954 Added 954 new packages, deleted 0 old in 19.43 seconds primary.xml.gz     100% |=========================| 829 kB   00:24 extras    : ############################################ 2324/2324 Added 2324 new packages, deleted 0 old in 41.74 seconds primary.xml.gz     100% |=========================| 824 kB   00:16 base      : ############################################ 2772/2772 Added 2772 new packages, deleted 0 old in 37.56 seconds MyODBC.i386                   2.50.39-25.FC4.1   updates-released NetworkManager.i386           0.4-20.FC4.1       updates-released NetworkManager-gnome.i386     0.4-20.FC4.1       updates-released … yum.noarch                    2.4.0-0.fc4        updates-released zlib.i386                     1.2.2.2-5.fc4      updates-released zlib-devel.i386               1.2.2.2-5.fc4      updates-released [root@swinetrek kermit]#

All of this output is an indication that the system is working as it should. yum compares the versions of RPM software installed locally with those available for download, then lists all of the packages that have been updated. If the system is newly installed, you'll probably see quite a few packages for which updates are available. Updating the system with these new packages is just a matter of entering yum update, as root, at the command prompt:

[root@swinetrek kermit]# yum update [root@swinetrek kermit]# yum update Setting up Update Process Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 347 kB   00:04 updates-re: ############################################ 966/966 Added 966 new packages, deleted 0 old in 35.21 seconds primary.xml.gz     100% |=========================| 855 kB   00:51 extras    : ############################################ 2361/2361 Added 2361 new packages, deleted 0 old in 52.41 seconds primary.xml.gz     100% |=========================| 824 kB   00:11 base      : ############################################ 2772/2772 Added 2772 new packages, deleted 0 old in 47.62 seconds Resolving Dependencies --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for glib2 to pack into transaction set. glib2-2.6.6-1.i386 100% |=========================|  21 kB   00:00 ---> Package glib2.i386 0:2.6.6-1 set to be updated ---> Downloading header for spamassassin to pack into transaction          set. spamassassin-3.0.4 100% |=========================|  31 kB   00:00 ---> Package spamassassin.i386 0:3.0.4-1.fc4 set to be updated … ---> Downloading header for pam to pack into transaction set. pam-0.79-9.5.i386. 100% |=========================|  62 kB   00:00 ---> Package pam.i386 0:0.79-9.5 set to be updated ---> Downloading header for libraw1394 to pack into transaction          set. libraw1394-1.2.0-1 100% |=========================| 4.9 kB   00:00 ---> Package libraw1394.i386 0:1.2.0-1.fc4 set to be updated --> Running transaction check --> Processing Dependency: python-numeric for package: pygtk2 --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for python-numeric to pack into          transaction set. python-numeric-23. 100% |=========================| 9.0 kB   00:00 ---> Package python-numeric.i386 0:23.7-2 set to be updated --> Running transaction check Dependencies Resolved ==================================================================  Package          Arch    Version           Repository       Size ================================================================== Installing:  kernel           i686    2.6.13-1.1526_FC4 updates-released 16 M  kernel-devel     i686    2.6.13-1.1526_FC4 updates-released 4.2 M Updating:  MyODBC           i386    2.50.39-25.FC4.1  updates-released 59 k  NetworkManager   i386    0.4-20.FC4.1      updates-released 181 k …  zlib             i386    1.2.2.2-5.fc4     updates-released 48 k  zlib-devel       i386    1.2.2.2-5.fc4     updates-released 98 k Installing for dependencies:  python-numeric   i386    23.7-2            base             679 k Transaction Summary ================================================================== Install      3 Package(s) Update     190 Package(s) Remove       0 Package(s) Total download size: 371 M Is this ok [y/N]: y Is this ok [y/N]: 

At the end of this output, yum lists the packages that are available for download, including the version, repository, and size of each download. Here we can see that the total download size is 371MB, so we may not want to run this update until there's plenty of bandwidth available on the network. Answer y at this prompt if you wish to continue:

Is this ok [y/N]: y Downloading Packages: (1/193): glib2-2.6 100% |=======================| 568 kB 00:09 (2/193): spamassas 100% |=======================| 685 kB 00:09 (3/193): system-co   8% |==                     |  71 kB 00:02 ETA 

yum will download all the listed packages.

(1/193): glib2-2.6 100% |=======================| 568 kB 00:09 (2/193): spamassas 100% |=======================| 685 kB 00:09 (3/193): system-co 100% |=======================| 307 kB 00:03 … (192/193): pam-0.7 100% |=======================| 1.9 MB 00:27 (193/193): libraw1 100% |=======================|  37 kB 00:00 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID     4f2a6fd2 public key not available for glib2-2.6.6-1.i386.rpm Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" Is this ok [y/N]: 

As we mentioned in Chapter 5, the RPM packages yum downloads are encrypted using a private key, so we need to import the public key to decrypt the package. Once yum has downloaded the public key, it can decrypt and install the packages.

Is this ok [y/N]: y Key imported successfully Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction   Updating  : libgcc               ##################### [  1/383]   Updating  : tzdata               ##################### [  2/383]   Updating  : glibc-common         ##################### [  3/383]   Updating  : glibc                ##################### [  4/383] Stopping sshd: [  OK  ] Starting sshd: [  OK  ]   Updating  : zlib                 ##################### [  5/383]   Updating  : glib2                ##################### [  6/383] …   Updating  : mod_ssl              ##################### [192/383]   Updating  : dhcpv6_client        ##################### [193/383]   Cleanup   : glib2                ##################### [194/383]   Cleanup   : spamassassin         ##################### [195/383] …   Cleanup   : pam                  ##################### [382/383]   Cleanup   : libraw1394           ##################### [383/383] Installed: kernel.i686 0:2.6.13-1.1526_FC4     kernel-devel.i686 0:2.6.13-1.1526_FC4 Dependency Installed: python-numeric.i386 0:23.7-2 Updated: MyODBC.i386 0:2.50.39-25.FC4.1     NetworkManager.i386 0:0.4-20.FC4.1 …     zlib.i386 0:1.2.2.2-5.fc4 zlib-devel.i386 0:1.2.2.2-5.fc4 Complete! [root@swinetrek kermit]#

Your system is now up to date with all patches released by Red Hat.

6.2.2.2. Updating a Single Package

yum will also allow you to update individual packages. You can do this by including the package name in the command line, just as we did when we updated Apache in Chapter 5:

[root@swinetrek kermit]# yum update bind Setting up Update Process Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files Could not find update match for bind No Packages marked for Update/Obsoletion [root@swinetrek kermit]# 

In this case, yum has found that the bind package on the system is up to date, but that's not always going to be the case. Here's what would happen if a new version of the bind package existed, and we decided to update the version we have on our server:

[root@swinetrek kermit]# yum update bind Setting up Update Process Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 342 kB   00:04 updates-re: ############################################ 954/954 Added 1 new packages, deleted 12 old in 5.09 seconds base      : ############################################ 2772/2772 Added 2772 new packages, deleted 0 old in 36.97 seconds Resolving Dependencies --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for bind to pack into transaction set. bind-9.3.1-10_FC4. 100% |=========================|  38 kB  00:01 ---> Package bind.i386 24:9.3.1-10_FC4 set to be updated --> Running transaction check --> Processing Dependency: bind-libs = 24:9.3.1-10_FC4 for          package: bind --> Processing Dependency: bind-utils = 24:9.3.1-10_FC4 for         package: bind --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for bind-utils to pack into          transaction set. bind-utils-9.3.1-1 100% |=========================|  28 kB  00:00 ---> Package bind-utils.i386 24:9.3.1-10_FC4 set to be updated ---> Downloading header for bind-libs to pack into          transaction set. bind-libs-9.3.1-10 100% |=========================|  30 kB  00:00 ---> Package bind-libs.i386 24:9.3.1-10_FC4 set to be updated --> Running transaction check Dependencies Resolved ==================================================================  Package          Arch    Version          Repository        Size ================================================================== Updating:  bind             i386    24:9.3.1-10_FC4  updates-released  510 k Updating for dependencies:  bind-libs        i386    24:9.3.1-10_FC4  updates-released  779 k  bind-utils       i386    24:9.3.1-10_FC4  updates-released  146 k Transaction Summary ================================================================== Install      0 Package(s) Update       3 Package(s) Remove       0 Package(s) Total download size: 1.4 M Is this ok [y/N]: y Downloading Packages: (1/3): bind-9.3.1- 100% |=========================| 510 kB  00:08 (2/3): bind-utils- 100% |=========================| 146 kB  00:02 (3/3): bind-libs-9 100% |=========================| 779 kB  00:09 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID     4f2a6fd2 public key not available for bind-9.3.1-10_FC4.i386.rpm Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" Is this ok [y/N]: y Key imported successfully Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction   Updating  : bind-libs            ######################### [1/6]   Updating  : bind-utils           ######################### [2/6]   Updating  : bind                 ######################### [3/6]   Cleanup   : bind                 ######################### [4/6]   Cleanup   : bind-utils           ######################### [5/6]   Cleanup   : bind-libs            ######################### [6/6] Updated: bind.i386 24:9.3.1-10_FC4 Dependency Updated: bind-libs.i386 24:9.3.1-10_FC4     bind-utils.i386 24:9.3.1-10_FC4 Complete! [root@swinetrek kermit]# 
6.2.2.3. Searching for and Installing Packages

So far, we've looked at updating currently installed software using yum, but we can also use it to install software from its repositories. In order to locate such software, we can use yum's search facility. Here, we're using yum search mathml to search for any packages that make mention of MathML in their metadata:

[root@swinetrek kermit]# yum search mathml Searching Packages: Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files mathml-fonts.noarch           1.0-18.fc4          extras Matched from: mathml-fonts This package contains fonts required to display mathematical symbols.  Applications supported include: * mozilla (and netscape >= 7) to display MathML * lyx * kformula (koffice) http://www.mozilla.org/projects/mathml/fonts/ mathml-fonts.noarch           1.0-15              extras Matched from: mathml-fonts This package contains fonts required to display mathematical symbols.  Applications supported include: * mozilla (and netscape >= 7) to display MathML * lyx * kformula (koffice) http://www.mozilla.org/projects/mathml/fonts/ gtkmathview.i386              0.7.5-2.fc4         extras Matched from: A MathML rendering library GtkMathView is a C++ rendering engine for MathML documents. It provides an interactive view that can be used for browsing and editing MathML markup. mathml-fonts.noarch           1.0-17.fc4          extras Matched from: mathml-fonts This package contains fonts required to display mathematical symbols.  Applications supported include: * mozilla (and netscape >= 7) to display MathML * lyx * kformula (koffice) http://www.mozilla.org/projects/mathml/fonts/ gtkmathview.i386              0.7.5-3.fc4         extras Matched from: A MathML rendering library GtkMathView is a C++ rendering engine for MathML documents. It provides an interactive view that can be used for browsing and editing MathML markup. [root@swinetrek kermit]# 

yum presents a list of all packages whose metadata contain the term "MathML." Let's take a closer look at the last package that yum found. The first line of this output provides the package name (gtkmathview.i386; the part after the dot indicates the processor architecture for which this package is built), the version of the package (0.7.5-3.fc4), and which repository the package was found in (extras). If the package is installed, the repository will be displayed as installed. Following this line, yum provides a description of the package.

To install this package, we use the yum install command. We can leave the architecture out of the package name; yum is smart enough to figure out which is the most appropriate package for this computer.

[root@swinetrek kermit]# yum install gtkmathview Setting up Install Process Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 342 kB   00:07 updates-re: ############################################ 954/954 Added 5 new packages, deleted 17 old in 5.74 seconds primary.xml.gz     100% |=========================| 855 kB   00:11 extras    : ############################################ 2361/2361 Added 37 new packages, deleted 0 old in 11.79 seconds Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages.         Please wait. ---> Downloading header for gtkmathview to pack into          transaction set. gtkmathview-0.7.5- 100% |=========================| 8.4 kB   00:00 ---> Package gtkmathview.i386 0:0.7.5-3.fc4 set to be updated --> Running transaction check Dependencies Resolved ==================================================================  Package          Arch    Version          Repository        Size ================================================================== Installing:  gtkmathview      i386    0.7.5-3.fc4      extras            958 k Transaction Summary ================================================================== Install      1 Package(s) Update       0 Package(s) Remove       0 Package(s) Total download size: 958 k Is this ok [y/N]: y Downloading Packages: (1/1): gtkmathview 100% |=========================| 958 kB   00:12 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID     1ac70ce6 public key not available for gtkmathview-0.7.5-3.fc4.i386.rpm Retrieving GPG key from file:     ///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras Importing GPG key 0x1AC70CE6     "Fedora Pre Extras Release <pre-extras@fedoraproject.org>" Is this ok [y/N]: y Key imported successfully Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction   Installing: gtkmathview          ######################### [1/1] Installed: gtkmathview.i386 0:0.7.5-3.fc4 Complete! [root@swinetrek kermit]# 
6.2.2.4. Removing Packages

You can use yum to remove packages cleanly from your system.

[root@swinetrek kermit]# yum remove bind Setting up Remove Process Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Package bind.i386 24:9.3.1-10_FC4 set to be erased --> Running transaction check Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 800 kB   00:10 extras    : ############################################ 2247/2247 Added 2 new packages, deleted 79 old in 11.69 seconds --> Processing Dependency: bind >= 9.1.3-0.rc2.3 for package:         caching-nameserver --> Processing Dependency: bind for package: caching-nameserver --> Processing Dependency: bind for package: NetworkManager --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages.         Please wait. ---> Package caching-nameserver.noarch 0:7.3-3 set to be erased ---> Package NetworkManager.i386 0:0.4-15.cvs20050404          set to be erased --> Running transaction check --> Processing Dependency: NetworkManager = 0.4-15.cvs20050404         for package: NetworkManager-gnome --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages.         Please wait. ---> Package NetworkManager-gnome.i386 0:0.4-15.cvs20050404         set to be erased --> Running transaction check Dependencies Resolved ==================================================================  Package          Arch    Version          Repository        Size ================================================================== Removing:  bind             i386    24:9.3.1-10_FC4  installed         1.4 M Removing for dependencies:  NetworkManager   i386    0.4-15.cvs200504 installed         482 k  NetworkManager-g i386    0.4-15.cvs200504 installed         180 k  caching-nameserv noarch  7.3-3            installed          43 k Transaction Summary ================================================================== Install      0 Package(s) Update       0 Package(s) Remove       4 Package(s) Total download size: 0 Is this ok [y/N]: y Downloading Packages: Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction   Removing  : caching-nameserver   ######################### [1/4] warning: /etc/rndc.key saved as /etc/rndc.key.rpmsave   Removing  : bind                 ######################### [2/4]   Removing  : NetworkManager-gnome ######################### [3/4]   Removing  : NetworkManager       ######################### [4/4] Removed: bind.i386 24:9.3.1-10_FC4 Dependency Removed: NetworkManager.i386 0:0.4-15.cvs20050404     NetworkManager-gnome.i386 0:0.4-15.cvs20050404     caching-nameserver.noarch 0:7.3-3 Complete! [root@swinetrek kermit]# 
6.2.2.5. Other yum Functions

yum can clean up its cache of RPM package headers with the command yum clean all, like so:

[root@swinetrek kermit]# yum clean all Cleaning up Everything 3 headers removed 3 packages removed 6 metadata files removed 0 cache files removed 3 cache files removed [root@swinetrek kermit]# 

Finally, yum also contains features that allow you to obtain information on specific packages:

[root@swinetrek kermit]# yum info gaim Setting up repositories updates-released   100% |=========================|  951 B   00:00 extras             100% |=========================| 1.1 kB   00:00 base               100% |=========================| 1.1 kB   00:00 Reading repository metadata in from local files primary.xml.gz     100% |=========================| 352 kB   00:19 updates-re: ############################################ 981/981 Added 27 new packages, deleted 12 old in 9.58 seconds primary.xml.gz     100% |=========================| 876 kB   02:12 extras    : ############################################ 2436/2436 Added 92 new packages, deleted 17 old in 17.71 seconds Installed Packages Name   : gaim Arch   : i386 Version: 1.5.0 Release: 1.fc4 Size   : 11 M Repo   : installed Summary: A GTK+ clone of the AOL Instant Messenger client. Description:  Gaim is a clone of America Online's Instant Messenger client. It features nearly all of the functionality of the official AIM client while also being smaller, faster, and commercial-free. [root@swinetrek kermit]# 

All in all, yum makes updating and maintaining the RPM packages on your system an easy process.




Run Your Own Web Server Using Linux & Apache
Run Your Own Web Server Using Linux & Apache
ISBN: 0975240226
EAN: 2147483647
Year: 2006
Pages: 92

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