Updating RedHat & CentOS with Yum

If you are using RedHat & its clones like CentOS or CloudLinux etc. you can use Yum or up2date to upgrade your current system.

Please note that is you have a RedHat Enterprise Linux Subscription we offer you to use the command up2date, to upgrade your server with yum write the command from shell:

yum upgrade

If it asks for the keys, you can press “Y” to accept the keys and continue to install the upgrades, to install an application or library with yum type:

yum install packagename

If you don’t know the package name containing the application you want to use, you can use the list function of yum.

For example to list packages related to dig similiar to Windows nslookup type the following command:

yum list dig*

Yum will find the packages names starting with dig, this function is so useful when finding apache modules (mod-*) and php modules (php-*) but this time it will return with an error as it cannot find any related packages names starting with dig*:

#Error: No matching Packages to list

Because some applications reside in a set of packages in Linux distros. Here comes the “whatprovides” in stage. If you used the command in Linux before but you don’t know the package containing the command you can find it easily with yum:

yum whatprovides */dig

and the output of yum is:

#30:bind-utils-9.3.6-4.P1.el5_4.2.x86_64 : Utilities for querying DNS name servers.
#Repo        : base
#Matched from:
#Filename    : /usr/bin/dig

Yum tell us the package we were searching for is bind-utils. When you install bind-utils you will have a bunch of useful utulities related to named. After this step the only thing you need to do is:

yum install bind-utils

and yum will install the package with all prerequisities.

IMPORTANT NOTE: This document is prepared for CentOS 5.6 and ment to work with other versions and distros.Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions — read, review, compare, apply as it fits your system.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: