Friday, August 17, 2012

How to configure a Local yum Server


Sometimes you feel it is necessary or to be handy to have a local yum server in your network.So let’s try to create a local yum server in your network in your centos/rhel server .


Requirements for local yum server configuration

1.http
2.yum
3.createrepo utility


Create a directory redhat under document root of http web server

#mkdir -p /var/www/html/redhat

Copy all rpm packages from RHEL DVD to /var/www/html/redhat then create repository using createrepo utility which shipped with Redhat DVD.

#createrepo /var/www/html/redhat

So, that will create your local yum repository.

Now you can use this repository by creating repo file in yum path.

# vi /etc/yum.repos.d/local.repo
[local]
name=Local yum server
baseurl=http://<yum server name>/redhat
enabled=1
gpgcheck=0

That’s it…

1 comment: