Monday, August 19

YUM Configuration in Linux RHEL/CentOS

                            YUM (YELLOW DOG UPDATE MODIFIER)

                YUM(Yellowdog Update Modifier) is a default package management tool in Redhat/ CentOS.By using yum tool we can install, upgrade,remove the packages and also we can see the information about packages.
                 YUM is an interactive tool which waits for the confirmation of a user, using this tool we can install the required package with dependencies.

For installing/Uninstalling a packages with yum :
 Syntax : # yum <option> <pkg-name>

            where options:
  •                        install          
  •                        remove
  •                        list
  •                        info
  •                        update
  •                        groupinstall
  •                        groupremove
  •                        grouplist
  •                        groupinfo, etc...

You can install Packages using yum, first create a repository of all packages using these steps.

Step1: To Mount the DVD, Copy OS DVD's content to Hard-Drive as below
         [root@bsrtech ~]# cd /media/path of files

         [root@bsrtech ~]# cp *  /pkgs

          where copy all packages in /pkgs directory

Note :  If you have RHEL5 DVD then execute below command once.

 Change directory, install "createrepo" package

       [root@bsrtech ~]# cd /pkgs

       [root@bsrtech ~]# rpm -ivh createrepo

 Install dependencies also

       [root@bsrtech ~]# rpm -ivh python-deltaparm

       [root@bsrtech ~]# rpm -ivh deltaparm
 Specify the repository location to yum.

       [root@bsrtech ~]# createrepo -v .

          where "." is present location

Step2: Create a file with repo as extension and 
specify the yum details in /etc/yum.repos.d

       [root@bsrtech ~]# cd /etc/yum.repos.d/

       [root@bsrtech ~]# vim pkgs.repo

                  name        =  "pkgs"
                  baseurl     =  file:///pkgs
                  gpgcheck =  0

       where gpgcheck is to check the authentication of repository.

Local YUM repository is created successfully, now you can install any package using yum command

Note : In order to use yum repository we have to clean the yum meta data, so before installing any package firsttime, use yum clean all command show below

       [root@bsrtech ~]# yum clean all
To see the list of packages in index i.e repository

        [root@bsrtech ~]# yum list
 To see list of installed packages

        [root@bsrtech ~]# yum list installed | less
 To install a package using yum

       [root@bsrtech ~]# yum install firefox*
 To remove package using yum

       [root@bsrtech ~]# yum remove firefox* -y

     where "y" means without confirmation.

1 comment:

  1. You could have mentioned about Yumex and Yum Plugins. Without them I feel Yum is incomplete. Im using Fedora 17 Desktop and I find Yumex a better GUI for YUM.


:: Linux - Legends ::