Sie sind auf Seite 1von 5

Creating Yum Local Repository

Date:18-09-2008

What is Yum: Yum stands for Yellow dog Updater,Modified. Yum is an automatic updater and package
installer/remover for rpm systems. It automatically computes dependencies and figures out what things
should occur to install packages. It makes it easier to maintain groups of machines without having to
manually update each one using rpm. You can use a single yum command to install as many packages
as
you want; just add each package name to the end of the command.

Features include:
 Multiple Repositories
 Simple config file
 Correct dependency calculation
 Fast operation
 rpm-consistent behavior
 comps.xml group support, including multiple repository groups
 Simple interface

Summary:
1. Create the directory structure of the repository
2. Copy the base RPMs
3. Create the base repository headers
4. Edit yum.conf

Yum Local Repository Server: 192.168.0.9


Repository Location : /var/ftp/pub/yum/RPMS5
Prerequisites : vsftp/http ( I created Repository with vsftp)

Server Side:
*Check that the createrepo rpm is installed in your system with this command
#rpm -qa createrepo
If command doesn't give any output you should install this rpm from Cds/DVD of RHEL5. Locate the
createrepo rpm from your RHEL5 Cds/DVD and give this command
# rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm

-------output--------------
warning: createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:createrepo ########################################### [100%]

*Create the directories named yum and RPMS5 in /var/ftp/pub with this command
#mkdir -p /var/ftp/pub/yum/RPMS5
*Copy the RPMs from the Cds/DVD to /var/ftp/pub/yum/RPMS5

*Create the RPMS5 repository headers with this command


#createrepo /var/ftp/pub/yum/RPMS5

----output------
2199/2199 - junit-javadoc-3.8.2-3jpp.1.i386.rpm

Saving Primary metadata

Saving file lists metadata

Saving other metadata

This might take some time, depending upon the speed of your processor(s)
and HD. On successful conclusion, createrepo should create a directory /repodata in RPMS5 directory.
The contents should be:
filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml

*Now you can install any rpms on client systems by editing /etc/yum.conf file

Client Side:

Add the following entries in /etc/yum.conf file

[RPMS]

#name=Red Hat Enterprise Linux $releaseserver - $basesearch - RPMS

name=RPMS $releaseserver - $basearch

baseurl=ftp://192.168.0.9/pub/yum/RPMS5

enabled=1
*Now on client system the /etc/yum.com file looks like this

*********************************************************************

[main]

cachedir=/var/cache/yum

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

pkgpolicy=newest

distroverpkg=redhat-release

tolerant=1

exactarch=1

obsoletes=1

gpgcheck=1 ** Note: change gpgcheck=0


plugins=1

metadata_expire=1800

# PUT YOUR REPOS HERE OR IN separate files named file.repo

# in /etc/yum.repos.d

[RPMS]

#name=Red Hat Enterprise Linux $releaseserver - $basesearch - RPMS

name=RPMS $releaseserver - $basearch

baseurl=ftp://192.168.0.9/pub/yum/RPMS5

enabled=1

****************************************************************

Yum Commands: ( Client Side)

#yum list available :- Is used to list various information about available packages on repository

server

#yum install <package> :-Is used to install packages.


#yum remove/erase <package> :- Are used to remove the specified packages from the system as
well as removing any packages which depend on the package being

removed.
*For more commands refer man pages of yum by
#man yum
NOTE: If you want to yum repository communication between client and yum server by “http” add the
this to your yum repository server http.conf file

<VirtualHost 192.168.0.9:80>
ServerAdmin webmaster@server.example.com
ServerName 192.168.0.9
DocumentRoot "/var/ftp/pub/yum/RPMS5/"
ErrorLog logs/server.example.com-error_log
CustomLog logs/server.example.com-access_log common
</Virtualhost>

After this restart httpd service

_______________________________
END_________________________________________________

Written by : Srinivasa Gowd .S

Das könnte Ihnen auch gefallen