Configure YUM Server and Client in Linux

YUM Server Setting


Confirm that ‘createrepo’ RPM is installed

#Rpm –qa|grep createrep

Installing YUM Server on RHEL5/6

Go to your WebServer root (mostly this directory will be readable for every one)

#cd /var/www/html/
#mkdir YUMRHEL6 (Create directory under webserver root)

Copy your entire RHEL Media (RHEL CD) on YUMRHEL6 Directory

#cp /media/* /var/www/html/YUMRHEL6 (Suppose your CD Drive is mount at /media)

Create repository

Normal Yum Repo:

# Createrepo /var/www/html/YUMRHEL6  (Create a database repository)

Group Yum Repo

# Createrepo -d -s sha -g /var/www/html/YUMRHEL6/repodata/5819e9580b5a81a9eec9e2c6e91fc9992a7ccadaa3bcd5ecb2e87a8669eefcec-comps-rhel6
-Server.xml /var/www/html/YUMRHEL6  (Create a database repository)

Installing YUM Server on RHEL4


Download Following RPMs


Install Downloaded RPMs

#rpm -ivh *.rpm

Create repository

 #createrepo -d -s sha -g /var/www/html/YUMRHEL48AS/32bit/RedHat/base/comps.xml /var/www/html/YUMRHEL48AS/32bit/

Clean your repository

#yum clean all

YUM Client Setting

Setup first ””yum’ client: localhost”’

Create file under ”’/etc/yum.repos.d”’

#vi /etc/yum.repos.d/NS128YUM.repo

Add following lines:

name=Red Hat Enterprise Linux $releasever - $basearch - Source

Note:(FOR RHEL5 Repo)

”'[Errno -3] Error performing checksum (if you find this error)”’

”’Reason:”’ Your YUM Server in on RHEL6 and you want to configure YUM for RHEL5. then your need to run below command.


#createrepo -d -s sha -g /var/www/html/YUMRHEL54/Server/repodata/comps-rhel5-server-core.xml /var/www/html/YUMRHEL54/


-s for Checksum Type (SHA)
-g (groupfile)

YUM Usage

Simple YUM:

  • ‘yum search unix2dos’ – searches for package
  • ‘yum info unix2dos’ – returns/dumps/enumerates package metadata
  • ‘yum install unix2dos’ – installs the package once
  • ‘yum reinstall unix2dos’ – reinstalls package. i.e. ‘–replacepkgs’ with ‘rpm’
  • ‘yum -y reinstall unix2dos’ – assumes yes when prompted
  • ‘yum history’ – returns usage history. i.e. BASH Shell history
  • ‘yum -y erase unix2dos dos2unix’ – assumes yes and removes both packages
  • ‘yum deplist lftp’ – dependencies and their providers are returned
  • ‘yum localinstall dos2unix-3.1-37.el6.i686.rpm’

Yum Group

  • yum groupinstall ‘Development Tools’ – Install a yum group (‘Development Tools’)
  • yum groupremove ‘Development Tools’ – Remove a Yum group (‘Development Tools’)
  • yum groupupdate ‘Development Tools’ – Update a Yum Group (‘Development Tools’)
  • yum groupinfo ‘Development Tools’ – List the packages in Yum Group (‘Development Tools’)
  • yum grouplist – List all available Yum Groups
  • yum list installed – To list all installed packages via YUM

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s