Movatterモバイル変換


[0]ホーム

URL:


Managing Packages With Yum


There are numerous package managers available for Linux systems. Several of the package managersoffer graphical front-ends, contain search capabilities, allow updates to be installed fromremote locations, and provide E-mail notifications when new packages are available. One packagemanager that provides all of these capabilities is YUM (YellowDog Updater Modified). This articlewill provide an introduction to package management with yum, and will show how a server thatuses yum can be configured to generate E-mail notification when new packages are available fora server.

Configuring yum

Yum reads its configuration from one or more configuration files. The mainconfiguration file is typically stored in /etc/yum.conf, and contains the default settingsto use when retrieving and intalling packages. A sample configuration file from aCentOS 4.0 server is shown below:

$cat /etc/yum.conf

[main]cachedir=/var/cache/yumdebuglevel=2logfile=/var/log/yum.logpkgpolicy=newestdistroverpkg=centos-releasetolerant=1exactarch=1retries=20obsoletes=1gpgcheck=1# PUT YOUR REPOS HERE OR IN separate files named file.repo# in /etc/yum.repos.d

In addition to the main yum.conf configuration file which is described in the yum.confmanual page, yum will look for remote repository definitions in the directory/etc/yum.repos.d. A sample repository definition from a CentOS 4.0 server is included below:

[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

Each repository definition starts with a descriptive name that is enclosed in brackets. Insideeach repository definition stanza is a line with a descriptive name, a flag to indicate if GPGsignatures should be checked, and the locations to retrieve updates and the GPG keys that areused to sign the updates. Variables can be be used in URLs, and in the example above the $releaseverand $basearch variables are used to reference the Operating System release and the file systembase where updates are located.

Viewing yum options

The yum script comes with several options to control the package management process. Theseoptions can be viewed by invoking yum with the “-h” (help) option:

$yum -h

usage: yum [options] < update | install | info | remove | list |    clean | provides | search | check-update | groupinstall |    groupupdate | grouplist | groupinfo | groupremove |    makecache | localinstall | erase | upgrade | whatprovides |    localupdate | resolvedep | shell | deplist >options:  -h, help            show this help message and exit  -t, tolerant        be tolerant of errors  -C                    run entirely from cache, dont update cache  -c  [config file]     config file location  -R  [minutes]         maximum command wait time  -d  [debug level]     debugging output level  -e  [error level]     error output level  -y                    answer yes for all questions  version             show Yum version and exit  installroot=[path]  set install root  enablerepo=[repo]   enable one or more repositories (wildcards allowed)  disablerepo=[repo]  disable one or more repositories (wildcards allowed)  exclude=[package]   exclude package(s) by name or glob  obsoletes           enable obsoletes processing during updates  noplugins           disable Yum plugins

The following sections will describe several of these options.

Listing installed packages

Before you can update packages on a system, it is first useful to see whichpackages are installed. Yum contains a “list” option to display the list ofinstalled packages. When invoked without arguments, list will show allpackages installed:

$ yum list |more

Setting up ReposReading repository metadata in from local filesInstalled Packages4Suite.i386                              1.0-3                  installedGConf2.i386                              2.8.1-1                installedGConf2-devel.i386                        2.8.1-1                installedHelixPlayer.i386                         1:1.0.6-0.fc3.1        installedImageMagick.i386                         6.2.2.0-2.fc3          installedMAKEDEV.i386                             3.13-1                 installedMaelstrom.i386                           3.0.6-6                installedNetworkManager.i386                      0.3.4-1.1.0.fc3        installedNetworkManager-gnome.i386                0.3.4-1.1.0.fc3        installed

If a string is passed as an argument to the list option, yum will look for all packagesthat match that string. The following example will list all packages with the name “curl”:

$ yum list curl

Setting up repositoriesrawhide-updates           100% |=========================| 1.1 kB    00:00updates                   100% |=========================| 1.1 kB    00:00testing-updates           100% |=========================|  951 B    00:00Reading repository metadata in from local filesAvailable Packagescurl.i386                                7.15.0-1               rawhide-updates

Getting package descriptions

The previous example showed the version of the installed curl package, and listed therepository the package was part of (in this case, rawhide-updates). It is somtimesuseful to get a description of what a package is. This can be accomplished by passinga package name to the yum “info” option:

$ yum info curl

Setting up repositoriesrawhide-updates           100% |=========================| 1.1 kB    00:00updates                   100% |=========================| 1.1 kB    00:00testing-updates           100% |=========================|  951 B    00:00Reading repository metadata in from local filesAvailable PackagesName   : curlArch   : i386Version: 7.15.0Release: 1Size   : 253 kRepo   : rawhide-updatesSummary: A utility for getting files from remote servers (FTP, HTTP, and others).Description:cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, andDict servers, using any of the supported protocols. cURL is designedto work without user interaction or any kind of interactivity. cURLoffers many useful capabilities, like proxy support, userauthentication, FTP upload, HTTP post, and file transfer resume.

The output from the info option displays the package details, the size of thepackage, and a detailed description of what the package can be used for.

Searching for packages

One of yum’s most powerful options is its search capabilities. Yum allowsyou to query packages by keyword, package name and pathname. The following exampleuses the curl “search” option to locate all packages that contain the string“curl” in their name:

$ yum search curl

Searching Packages:Setting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filesprimary.xml.gz            100% |=========================| 977 kB    00:01extras    : ################################################## 2714/2714Added 8 new packages, deleted 0 old in 6.47 secondscurl.i386                                7.13.1-3               baseMatched from:curlcURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, andDict servers, using any of the supported protocols. cURL is designedto work without user interaction or any kind of interactivity. cURLoffers many useful capabilities, like proxy support, userauthentication, FTP upload, HTTP post, and file transfer resume.http://curl.haxx.se/curl-devel.i386                          7.13.1-3               baseMatched from:curl-develFiles needed for building applications with libcurl.cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, andDict servers, using any of the supported protocols. The curl-develpackage includes files needed for developing applications which canuse cURL's capabilities internally.http://curl.haxx.se/curl.i386                                7.13.1-3               installedMatched from:curlcURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, andDict servers, using any of the supported protocols. cURL is designedto work without user interaction or any kind of interactivity. cURLoffers many useful capabilities, like proxy support, userauthentication, FTP upload, HTTP post, and file transfer resume.http://curl.haxx.se/

In addition to searching for package names, yum’s “whatprovides” option can be used tolocate the package that contains a specific executable:

$ yum whatprovides /etc/yum.conf

Searching Packages:Setting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filesprimary.xml.gz            100% |=========================| 977 kB    00:01extras    : ################################################## 2714/2714Added 8 new packages, deleted 0 old in 6.65 secondsyum.noarch                               2.3.2-7                baseMatched from:/etc/yum.confyum.noarch                               2.4.0-0.fc4            updates-releasedMatched from:/etc/yum.confyum.noarch                               2.4.0-0.fc4            installedMatched from:/etc/yum.conf

This example shows that /etc/yum.conf is part of the yum.noarch package.

Viewing package dependencies

Most packages that come with a Linux distributions contain one or moredependencies. A prefect example of this is the Apache web server. Apachedepends on the openssl package to provide SSL support, the zlib package todeflate content, and the PHP package if PHP is in use. Managing packagesand their dependencies is one area where yum really shines. Not only doesyum automatically detect and resolve dependencies, but it allowsyou to view package dependencies with the “deplist” option:

$ yum deplist curl

Finding dependencies:Setting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filespackage: curl.i386 7.13.1-3  dependency: libdl.so.2   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libkrb5.so.3   provider: krb5-libs.i386 1.4-3   provider: krb5-libs.i386 1.4.1-5  dependency: libc.so.6(GLIBC_2.1)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libcrypto.so.5   provider: openssl.i686 0.9.7f-7   provider: openssl.i386 0.9.7f-7   provider: openssl.i386 0.9.7f-7.10   provider: openssl.i686 0.9.7f-7.10  dependency: libc.so.6   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libc.so.6(GLIBC_2.0)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libc.so.6(GLIBC_2.3.4)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libdl.so.2(GLIBC_2.1)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libz.so.1   provider: zlib.i386 1.2.2.2-3   provider: zlib.i386 1.2.2.2-5.fc4  dependency: libidn.so.11   provider: libidn.i386 0.5.15-1  dependency: libc.so.6(GLIBC_2.1.3)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libdl.so.2(GLIBC_2.0)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libcom_err.so.2   provider: e2fsprogs.i386 1.37-4   provider: e2fsprogs.i386 1.38-0.FC4.1  dependency: /bin/sh   provider: bash.i386 3.0-31  dependency: openssl   provider: openssl.i686 0.9.7f-7   provider: openssl.i386 0.9.7f-7   provider: openssl.i386 0.9.7f-7.10   provider: openssl.i686 0.9.7f-7.10  dependency: libresolv.so.2   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libc.so.6(GLIBC_2.3)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libcurl.so.3   provider: curl.i386 7.13.1-3  dependency: libgssapi_krb5.so.2   provider: krb5-libs.i386 1.4-3   provider: krb5-libs.i386 1.4.1-5  dependency: libkrb5support.so.0   provider: krb5-libs.i386 1.4-3   provider: krb5-libs.i386 1.4.1-5  dependency: libgssapi_krb5.so.2(gssapi_krb5_2_MIT)   provider: krb5-libs.i386 1.4-3   provider: krb5-libs.i386 1.4.1-5  dependency: libssl.so.5   provider: openssl.i686 0.9.7f-7   provider: openssl.i386 0.9.7f-7   provider: openssl.i386 0.9.7f-7.10   provider: openssl.i686 0.9.7f-7.10  dependency: libc.so.6(GLIBC_2.2)   provider: glibc.i386 2.3.5-10   provider: glibc.i686 2.3.5-10   provider: glibc.i386 2.3.5-10.3   provider: glibc.i686 2.3.5-10.3  dependency: libk5crypto.so.3   provider: krb5-libs.i386 1.4-3   provider: krb5-libs.i386 1.4.1-5

As you can see from the output, curl requires several packages to work as expected.

Installing and removing packages with yum

Up to this point we have shown how to use yum to view package metadata. The realheart of a package manager is its ability to install packages, remove packages, andto handle the dependencies that are associated with a specific release of a package.Yum allows packages to be installed with the “install” option, which takes one ormore packages to install as arguments. The following example show how to installthe curl package and all of its dependencies:

$ yum install curl

Setting up Install ProcessSetting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filesParsing package install argumentsResolving Dependencies--> Populating transaction set with selected packages. Please wait.---> Downloading header for curl to pack into transaction set.curl-7.13.1-3.i386.rpm    100% |=========================|  10 kB    00:00---> Package curl.i386 0:7.13.1-3 set to be updated--> Running transaction checkDependencies Resolved============================================================================= Package                 Arch       Version          Repository        Size=============================================================================Installing: curl                    i386       7.13.1-3         base              262 kTransaction Summary=============================================================================Install      1 Package(s)Update       0 Package(s)Remove       0 Package(s)Total download size: 262 kIs this ok [y/N]: yDownloading Packages:(1/1): curl-7.13.1-3.i386 100% |=========================| 262 kB    00:00Running Transaction TestFinished Transaction TestTransaction Test SucceededRunning Transaction  Installing: curl                         ######################### [1/1] Installed: curl.i386 0:7.13.1-3Complete!

Packages can be removed just as easily as they can be added. To remove the curlpackage that we just installed, the package name can be passed as an argument tothe “remove” option:

$ yum remove curl

Setting up Remove ProcessResolving Dependencies--> Populating transaction set with selected packages. Please wait.---> Package curl.i386 0:7.13.1-3 set to be erased--> Running transaction checkDependencies Resolved============================================================================= Package                 Arch       Version          Repository        Size=============================================================================Removing: curl                    i386       7.13.1-3         installed         521 kTransaction Summary=============================================================================Install      0 Package(s)Update       0 Package(s)Remove       1 Package(s)Total download size: 0Is this ok [y/N]: yDownloading Packages:Running Transaction TestFinished Transaction TestTransaction Test SucceededRunning Transaction  Removing  : curl                         ######################### [1/1]Removed: curl.i386 0:7.13.1-3Complete!

Checking for new package versions

One of yum’s nicest features is its ability to install packages fromremote repositories, and to compare the currently installed packageswith what is available remotely. To compare the currently installedpackages with the versions that are available in one or moreremote repositories, yum can be invoked with the “check-update” option:

$ yum check-update

Setting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filesprimary.xml.gz            100% |=========================| 337 kB    00:01updates-re: ################################################## 989/989Added 105 new packages, deleted 83 old in 4.52 secondsprimary.xml.gz            100% |=========================| 977 kB    00:00extras    : ################################################## 2714/2714Added 8 new packages, deleted 0 old in 6.60 secondsbind.i386                                24:9.3.1-14_FC4        updates-releasedbind-libs.i386                           24:9.3.1-14_FC4        updates-releasedbind-utils.i386                          24:9.3.1-14_FC4        updates-releasedesound.i386                              1:0.2.36-0.fc4.1       updates-releasedesound-devel.i386                        1:0.2.36-0.fc4.1       updates-releasedgawk.i386                                3.1.4-5.3              updates-releasedgdb.i386                                 6.3.0.0-1.84           updates-releasedlogwatch.noarch                          7.0-1.fc4              updates-releasedmutt.i386                                5:1.4.2.1-4.FC4        updates-releasedpam.i386                                 0.79-9.6               updates-releasedpam-devel.i386                           0.79-9.6               updates-releasedsudo.i386                                1.6.8p8-2.3            updates-released

In this example we can see that numerous packages are outdated by newer version. Toupdate all of the outdated packages to newer versions, yum can be run with the “update”option:

$ yum update

Setting up Update ProcessSetting up repositoriesupdates-released          100% |=========================|  951 B    00:00extras                    100% |=========================| 1.1 kB    00:00base                      100% |=========================| 1.1 kB    00:00Reading repository metadata in from local filesResolving Dependencies--> Populating transaction set with selected packages. Please wait.---> Downloading header for bind to pack into transaction set.bind-9.3.1-14_FC4.i386.rp 100% |=========================|  39 kB    00:00---> Package bind.i386 24:9.3.1-14_FC4 set to be updated---> Downloading header for gawk to pack into transaction set.gawk-3.1.4-5.3.i386.rpm   100% |=========================|  17 kB    00:00---> Package gawk.i386 0:3.1.4-5.3 set to be updated---> Downloading header for sudo to pack into transaction set.sudo-1.6.8p8-2.3.i386.rpm 100% |=========================|  11 kB    00:00---> Package sudo.i386 0:1.6.8p8-2.3 set to be updated---> Downloading header for esound-devel to pack into transaction set.esound-devel-0.2.36-0.fc4 100% |=========================| 6.6 kB    00:00---> Package esound-devel.i386 1:0.2.36-0.fc4.1 set to be updated---> Downloading header for pam-devel to pack into transaction set.pam-devel-0.79-9.6.i386.r 100% |=========================|  40 kB    00:00---> Package pam-devel.i386 0:0.79-9.6 set to be updated---> Downloading header for bind-libs to pack into transaction set.bind-libs-9.3.1-14_FC4.i3 100% |=========================|  31 kB    00:00---> Package bind-libs.i386 24:9.3.1-14_FC4 set to be updated---> Downloading header for pam to pack into transaction set.pam-0.79-9.6.i386.rpm     100% |=========================|  62 kB    00:00---> Package pam.i386 0:0.79-9.6 set to be updated---> Downloading header for bind-utils to pack into transaction set.bind-utils-9.3.1-14_FC4.i 100% |=========================|  29 kB    00:00---> Package bind-utils.i386 24:9.3.1-14_FC4 set to be updated---> Downloading header for esound to pack into transaction set.esound-0.2.36-0.fc4.1.i38 100% |=========================|  11 kB    00:00---> Package esound.i386 1:0.2.36-0.fc4.1 set to be updated---> Downloading header for logwatch to pack into transaction set.logwatch-7.0-1.fc4.noarch 100% |=========================|  31 kB    00:00---> Package logwatch.noarch 0:7.0-1.fc4 set to be updated---> Downloading header for mutt to pack into transaction set.mutt-1.4.2.1-4.FC4.i386.r 100% |=========================|  19 kB    00:00---> Package mutt.i386 5:1.4.2.1-4.FC4 set to be updated---> Downloading header for gdb to pack into transaction set.gdb-6.3.0.0-1.84.i386.rpm 100% |=========================|  48 kB    00:00---> Package gdb.i386 0:6.3.0.0-1.84 set to be updated--> Running transaction checkDependencies Resolved============================================================================= Package                 Arch       Version          Repository        Size=============================================================================Updating: bind                    i386       24:9.3.1-14_FC4  updates-released  532 k bind-libs               i386       24:9.3.1-14_FC4  updates-released  779 k bind-utils              i386       24:9.3.1-14_FC4  updates-released  146 k esound                  i386       1:0.2.36-0.fc4.1  updates-released  127 k esound-devel            i386       1:0.2.36-0.fc4.1  updates-released   31 k gawk                    i386       3.1.4-5.3        updates-released  1.7 M gdb                     i386       6.3.0.0-1.84     updates-released  2.7 M logwatch                noarch     7.0-1.fc4        updates-released  217 k mutt                    i386       5:1.4.2.1-4.FC4  updates-released  1.1 M pam                     i386       0.79-9.6         updates-released  1.9 M pam-devel               i386       0.79-9.6         updates-released   87 k sudo                    i386       1.6.8p8-2.3      updates-released  185 kTransaction Summary=============================================================================Install      0 Package(s)Update      12 Package(s)Remove       0 Package(s)Total download size: 9.5 MIs this ok [y/N]: yDownloading Packages:(1/12): bind-9.3.1-14_FC4 100% |=========================| 532 kB    00:02(2/12): gawk-3.1.4-5.3.i3 100% |=========================| 1.7 MB    00:03(3/12): sudo-1.6.8p8-2.3. 100% |=========================| 185 kB    00:01(4/12): esound-devel-0.2. 100% |=========================|  31 kB    00:00(5/12): pam-devel-0.79-9. 100% |=========================|  87 kB    00:00(6/12): bind-libs-9.3.1-1 100% |=========================| 779 kB    00:02(7/12): pam-0.79-9.6.i386 100% |=========================| 1.9 MB    00:04(8/12): bind-utils-9.3.1- 100% |=========================| 146 kB    00:00(9/12): esound-0.2.36-0.f 100% |=========================| 127 kB    00:00(10/12): logwatch-7.0-1.f 100% |=========================| 217 kB    00:01(11/12): mutt-1.4.2.1-4.F 100% |=========================| 1.1 MB    00:02(12/12): gdb-6.3.0.0-1.84 100% |=========================| 2.7 MB    00:05Running Transaction TestFinished Transaction TestTransaction Test SucceededRunning Transaction  Updating  : bind-libs                    ####################### [ 1/24]  Updating  : pam                          ####################### [ 2/24]  Updating  : esound                       ####################### [ 3/24]  Updating  : bind-utils                   ####################### [ 4/24]  Updating  : bind                         ####################### [ 5/24]  Updating  : gawk                         ####################### [ 6/24]  Updating  : sudo                         ####################### [ 7/24]  Updating  : esound-devel                 ####################### [ 8/24]  Updating  : pam-devel                    ####################### [ 9/24]  Updating  : logwatch                     ####################### [10/24]  Updating  : mutt                         ####################### [11/24]  Updating  : gdb                          ####################### [12/24]  Cleanup   : bind                         ####################### [13/24]  Cleanup   : gawk                         ####################### [14/24]  Cleanup   : sudo                         ####################### [15/24]  Cleanup   : esound-devel                 ####################### [16/24]  Cleanup   : pam-devel                    ####################### [17/24]  Cleanup   : bind-libs                    ####################### [18/24]  Cleanup   : pam                          ####################### [19/24]  Cleanup   : bind-utils                   ####################### [20/24]  Cleanup   : esound                       ####################### [21/24]  Cleanup   : logwatch                     ####################### [22/24]  Cleanup   : mutt                         ####################### [23/24]  Cleanup   : gdb                          ####################### [24/24]Updated: bind.i386 24:9.3.1-14_FC4 bind-libs.i386 24:9.3.1-14_FC4 bind-utils.i386 24:9.3.1-14_FC4 esound.i3861:0.2.36-0.fc4.1 esound-devel.i386 1:0.2.36-0.fc4.1 gawk.i386 0:3.1.4-5.3 gdb.i386 0:6.3.0.0-1.84 logwatch.noarch0:7.0-1.fc4 mutt.i386 5:1.4.2.1-4.FC4 pam.i386 0:0.79-9.6 pam-devel.i386 0:0.79-9.6 sudo.i386 0:1.6.8p8-2.3Complete!

If you would prefer to update a single package, you can pass the package name as an argument to the yumupdate option.

Cleaning up the yum cache

The yum package manager maintains a cache of headers and files in /var/cache/yum. Thiscache can grow rather large over time, and can be cleaned with the yum “clean” option:

$ yum clean all

Cleaning up Everything251 headers removed251 packages removed6 metadata files removed0 cache files removed3 cache files removed

You can also clean individual items such as headers and packages by passing the itemto clean to the clean option. Since the yum cache can consume a fair amount of diskspace, the clean option should be used periodically to free up disk space.

Getting E-mail notifications when new packages are available

The process of managing packages is tedious, and having to manually check for updatesis a pain. To simplify this process, I developed the yumnotifier shell script. Yumnotifierwill process the output from the check-update command, and if it determines that updatesare available, it will E-mail the address defined in the global $ADMIN variable. Thescript is designed to be run from cron, and will generate an E-mail similar to thefollowing if updates are available:

From root@localhost.localdomain  Sat Jul 15 19:24:59 2006Date: Sat, 15 Jul 2006 19:24:59 -0400From: root <root@localhost.localdomain>To: matty@localhost.localdomainSubject: Updates available for biscuit==== The following updates are available for biscuit ===comps.i386                               2:4.3CENTOS-0.20060314 base            gtk2.i386                                2.4.13-18              base            kernel.i686                              2.6.9-34.0.2.EL        update          libtiff.i386                             3.6.1-10               update          mysql.i386                               4.1.20-1.RHEL4.1       update          mysql-devel.i386                         4.1.20-1.RHEL4.1       update          newt.i386                                0.51.6-7.rhel4         base            php.i386                                 4.3.9-3.15             update          php-ldap.i386                            4.3.9-3.15             update          php-pear.i386                            4.3.9-3.15             update          postgresql-libs.i386                     7.4.13-2.RHEL4.1       update          rpmdb-CentOS.i386                        2:4.3-0.20060314       base            sendmail.i386                            8.13.1-3.RHEL4.5       update          sendmail-cf.i386                         8.13.1-3.RHEL4.5       update          spamassassin.i386                        3.0.6-1.el4            update          vixie-cron.i386                          4:4.1-44.EL4           update          xorg-x11-Mesa-libGL.i386                 6.8.2-1.EL.13.25.1     update          xorg-x11-font-utils.i386                 6.8.2-1.EL.13.25.1     update          xorg-x11-libs.i386                       6.8.2-1.EL.13.25.1     update          xorg-x11-xauth.i386                      6.8.2-1.EL.13.25.1     update          xorg-x11-xfs.i386                        6.8.2-1.EL.13.25.1     update

To apply the updates in the output, the yum “update” or “upgrade” options can be used.

Conclusion

As we have seen in this article, yum comes with several options to search, installand remove the packages on a system. These features make yum a powerful packagemanager, and the ability to retrieve and update package from remote locations makeit a perfect solution for most environments.

References

The following references were used while writing this article:



[8]ページ先頭

©2009-2025 Movatter.jp