Home > Enterprise Linux Tips > Administrator > Configuring YUM on Linux
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADMINISTRATOR

Configuring YUM on Linux


Ken Milberg, Contributor
06.16.2009
Rating: -3.50- (out of 5)


Enterprise IT tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Last time we visited Yellow Dog Updater Modified (YUM) in 2007 we created a repository and also configured access to repositories in RHEL5. In this, our second look at YUM – we'll configure YUM by using its main configuration file, yum.conf, which resides in /etc. We'll also take you through some basic yum commands that should be a part of your repertoire.

For any yum newbie's, a quick definition and a look at history. YUM is a package manager (an installer and remover) for RPM systems. It is tailor made to update groups of machines without having to update each specific RPM. The software locates and obtains the correct RPM packages from repositories, freeing you from having to manually find and install new applications and/or updates. The beauty of YUM is in its simplicity. You can use a single command to update all system software. Way back when, RHEL4 used to use up2date as its package manager – RHEL5 uses YUM, based on version 3. Upd2date is actually used as a wrapper around YUM in RHEL5. The product was developed by Seth Vidal (who now works for Red Hat) and a group of volunteer programmers and coded in Python. It is now up to version 3.2.22.

yum.conf
The file itself is made up of two sections. The first is the main section and the second is the repository section. You have a choice to put your repositories in this file or in separate files named file.repo. You can have more than one repository in one configuration file but there can be only one main section. Here is an example of a yum config file.

Let's describe some important fields:

Cachedir: The directory where yum stores its cache and database files.

Keepcache: There are two choices here, 0 and 1. 1 informs yum to keep the cache of headers and packages after a successful install. The default ...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Red Hat Enterprise Linux (RHEL)  (SearchEnterpriseLinux.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


is 1.

Tolerant: There are two choices here, 0 and 1. Setting this as 1 allows yum to be tolerant of errors on the command line. The default is 0.

Grpcheck: There are two choices here, 0 and 1. 1 enables GPG checking, which provides for GPG signature checking on packages on all repositories. This includes local package installation.

Metadata_expire: This is the time in seconds – after which the metadata will expire.

Timeout: This is the number of seconds that one would wait for a connection prior to timing out.

Exactarch: There are two choices here, 0 and 1. 1 tells YUM to update only the architectures of installed packages. For example, if you have this enabled you won't be able to install an i386 package to update an i686 package.

Obsoletes: This effects updates only and enables the processing logic of YUM. It's particularly useful when doing distribution level upgrades.

The repository section has the information required to find packages during package installation, updating and dependency installations. The mandatory field descriptions are as follows:

ID: a unique single word string which is the identifier of the repository.

Name: The string that describes the repository.

Baseurl: The url where the actual repository is housed.

Some optional fields include; and . The exclude and include fields are similar to the ones used in the main section of the file, but apply only to a specific repository.

If you are shy about manually editing config files, than I would be extremely careful before doing so. Better to use some GUI software to help you configure YUM, than mess up a currently running YUM-based system. If you are going to edit these files manually, make sure you first play around with them in a test environment and/or have good backups. It just takes five seconds to issue the following command:

Please use this command prior to manually editing this file.

yummy commands
YUM has dozens of commands that are part of its system. Try to learn some of the key commands that you'll be using routinely. In this section we'll discuss some of these commands.

This lists out all packages in all repositories which are installed on the system. There are a variety of options with this command. One option is:

This is similar to running an , which breaks down a list of all installed packages. By default without any options will list all packages in all the repositories, and all the packages installed on your system. (Note: "yum list all" and "yum list" give the same output.)

Displays information about any package – either installed or available.

Allows you to search for information from metadata available, about packages.

The yum clean command allows you to clean up the cached files of metadata and packages which YUM uses during its normal operations. This will clear up a lot of disk space.

This provides you with detailed information for each group including description, mandatory, default and optional packages.

We've focused on using YUM on RHEL, but it should also be noted that SLES10.1 has added support for YUM repositories in YaST. Many other distributions also provide YUM support – though some do not, so if YUM is really important to you, you should check your documentation carefully. Finally, as those of you who have already worked with YUM realize, it has a command line utility only. If you like GUI software there are also several GUI utilities which interface with YUM, including pup, pirut (the default Fedora GUI as of version 5), and Yum Extender. YUM may not be rocket science to use, but you will need to take some time to learn it properly. Like any other new software, the more time you spend learning it and playing with it in a sandbox the less time you will spend in having to fix it later.

ABOUT THE AUTHOR: Ken Milberg is a systems consultant with two decades of experience working with Unix and Linux systems. He is a SearchEnterpriseLinux.com Ask the Experts advisor and columnist.

Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts