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=file:///path_to_repo_Location
# baseurl=http://IP_Address/yum
gpgcheck=0
------------------------------------------------

Plan:
Package needed on server,

httpd
yum
createrepo

Package on client
yum

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
/usr/bin/createrepo
or
# rpm –qa | grep createrepo

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

# createrepo .
or
# 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
[RHEL-Repository]
name=RHEL repository
baseurl=file:///path_to_repo_Location
# baseurl=http://IP_Address/yum
enabled=1
gpgcheck=0


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

ServerAdmin root@192.168.0.155
DocumentRoot /var/www/html
ServerName 192.168.0.155

(Where 192.168.0.155 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

[RH51-Server]
name= RHEL5 repository
baseurl=http://192.168.0.155/yum
# baseurl=file:///var/www/html/yum
enabled=1
gpgcheck=0

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
OR
# yum update

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

No comments:

Post a Comment