Monday, October 25, 2010

Creating your own Yum Repository Server

One of the best tool (YUM) provided by Redhat Linux for Installing complete Package. Using Yum you can build your own repository server, which can be used to upgrade all systems in network. Simple steps for creating repository server can be found below. In this example we will be using FTP share as location for our repository.


Pre Requisit's:
  1. Server with Rhel 5 OS installed. hostname of that server in this example is kept ftp.xyz.com
  2. FTP server to installed . ( No need to setup FTP share, as by default /var/ftp/pub is shared, once FTP server is installed. Make sure that vsftpd demon is running. )
Server Side


1. Copy the iso to pub
 # cp -r /media/RHEL...../Server /var/ftp/pub
2. install create repo package Create repo
 # cd /var/ftp/pub/Server
 # rpm  -ivh createrepo*
3. copy the core.xml file in Server and create repo using below commands
 # cd /media/RHEL..../Server/repodata
 # cp comps-rhel5-Server-core.xml  /var/ftp/pub/Server
 #cd /ver/ftp/pub/Server
 # createrepo -g comps-rhel5-Server-core.xml
4. Edit yum.conf file
  # vi /etc/yum.conf     ( Add Below line at end of file (
                [Server]
                name=Server
                baseurl=file:///var/ftp/pub/Server
                enabled=1
  # yum clean all
  # yum update
  # yum repo list
  # rpm --import /etc/pki/rpm-gpg/*
Client side


1. remove rhel.debug.info
  # cd /etc/yum.repos.d/
  # rm  -rf rhel.debug.info
2. create client.repo
   # vi client.repo
                [Client]
                name=Client
                baseurl=ftp://yum-server.mylabs.org(yum-serv's  ip)/pub/Server
                enabled=1
3. start ftp daemon
     # /etc/init.d/vsftpd start
     # chkconfig --level 35 vsftpd on
4. Update yum client
     # yum clean all
     # yum update
     # yum repolist
     # rpm --import  /etc/pki/rpm-gpg/*
 5. now from client is ready to use to yum server, example, we will install mysql package
   # yum install mysql*
    

No comments:

Post a Comment