Friday, December 23, 2011

What is YUM ? How to configure a yum repository?

What is YUM (Yellow dog Updater, Modified) Package Manager?

YUM (Yellow dog Updater, Modified") is an RPM-based package management application for Linux based operating systems. A package is

usually a software application. YUM normally comes bundled with many Linux distributions. YUM downloads software from repositories

over the network, either on the local network or over the Internet. The repositories are organized in such a way that they can be

found by the YUM client.YUM checks for package dependencies and downloads the packages and installs them.

Benefit of using YUM

- Automatic checks the software dependencies.
- it is available on command line as well on graphical interface program.

How Create a local YUM repository

Configure a yum local repository to be able to access via HTTP on Red Hat?

How do I configure a yum local repository to be able to access a DVD ISO via HTTP on Red Hat Enterprise Linux?

Setting up yum is very easy. Either server or client
Just use the following template.

Requirement, You will need repo location: /opt/RH6.3/Packages
For client, ip address and shared location (for nfs)
Note: create a file with extension .repo at /etc/yum.repos.d/
[base]  ==> just name anything you want
name=My Redhat Repo  ==> just name the repo
# baseurl=http://IP_Address/yum

Package needed on server,


Package on client

A. Copy the Red Hat DVD ISO image or DVD copy on the local Repository server.

a. Create a dir in the Document Root named yum/iso
# mkdir -p /var/www/html/yum/iso

b. mount the iso or cdrom and copy the content.
# mount -o loop /RHELX-DVD.iso /var/www/html/yum/iso
# cp -r /path_of_cdrom/Packages/* /var/www/html/yum/

# cd /var/www/html/yum
# which createrepo
# rpm –qa | grep createrepo

If you its not installed, install it.
# yum install createrepo

# createrepo .
# createrepo /var/www/html/yum/
# ls -l /var/www/html/yum/repodata/
# yum clean all

B. Create a file /etc/yum.repos.d/my.repo with following info.
# cat /etc/yum.repos.d/my.repo
name=RHEL repository
# baseurl=http://IP_Address/yum

3. Share with httpd by making sure you have lines like these in your /etc/httpd/conf/httpd.conf file:

ServerAdmin root@
DocumentRoot /var/www/html

(Where is the local Repository server)

# httpd -t
# service httpd start or
# /etc/init.d/httpd start

[ ---------------------------
if http is not installed?

# yum install httpd
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start or
# service httpd start
---------------------------- ]

4. Client side configuration:
# vi /etc/yum.repos.d/my.repo

name= RHEL5 repository
# baseurl=file:///var/www/html/yum

Note: If the repository is not needed to update the repository server itself, file_name.repo is not required on the local repository server.

5. Verify from client:
# yum list
# yum update

# yum search httpd - search
# yum install httpd - install
# yum remove httpd - remove

No comments:

Post a Comment