Configure YUM Server and Client in Linux

YUM Server Setting

Perquisite

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

Prerequisite

Download Following RPMs

python-elementtree-1.2.6-7.el4.rf.i386.rpm
python-sqlite-1.0.1-1.2.el4.rf.i386.rpm
python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm
sqlite-2.8.17-1.el4.rf.i386.rpm
yum-2.4.2-0.4.el4.rf.noarch.rpm

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:

[YUM-Repo]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=http://10.0.9.128:81/YUMRHEL6/
enabled=1  
gpgcheck=0

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.

Resolution

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

Where: 

-d=database
-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
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s