Friday, April 20, 2012

yum update Red Hat Linux / Fedora

Yum (Yellowdog Updater Modified) is a powerful automatic updater and package installer/remover on RPM-based Linux distributions like Red Hat / Fedora.

Yum automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.

The main Yum configuration file is /etc/yum.conf. Basic repository listings are located in the /etc/yum.repos.d/ directory. Unless you plan on adding other repositories or have a need to tweak certain configuration settings, these configuration files work as-is. Please refer to yum.conf manual page to find out the various options for this configuration file. You may like to take note about the keepcache option in this file. Set keepcache=1 if you want to keep the downloaded RPM files from erased after they are installed. However, make sure the cachedir directory has enough space to save the downloaded files.

To install a package with Yum, simply running Yum with the install option:

# yum install gimp
This will install the GIMP package and any dependencies it may have. You can specify more than one package at a time to install.

To get full information on a package installed, such as version, architecture, and a description, execute the following command:

# yum info [package]
If you are not sure what a package is called, you can search the software description in repository metadata using Yum’s search option. For example, the following command search for GIMP in any package description:

# yum search gimp
If you want to list an available package, you can use the list command. This will list all available packages and note which are installed. For example:

# yum list gimp
Software always comes with bugs. As such, regular software update is important to help patching any potential problem. Yum offers several ways of getting the updates information. To find out if any package has any update available, but without performing any upgrade actions, use yum check-update and a list of available updates will be printed.

To upgrade packages, either specify the package to upgrade with the update option or do not specify any packages to update all packages that have updates available:

# yum update
To remove a package from the system, use the remove command. This will remove the noted package as well as any requirements for that package that are no longer required by other packages.

Although Yum is designed to use over the network, you may also use it to install packages locally (by inserting a Linux distribution CD/DVD or copying a RPM to a local directory). Simly use the localinstall option to yum will do. For example, if your CD is mounted at /media/disk, you could execute the following command to install the gimp package:

# yum localinstall /media/disk/Fedora/RPMS/gimp-*
Overall, Yum is a decent package manager. Most individuals will likely use graphical frontends to Yum, but knowing the Yum commands directly is a great idea in case X is not working or you are working remotely on a server.

By the way, Yum is written using python.

No comments:

Post a Comment