Friday, October 29, 2010

Making your own YUM Server

Hi Guys,

I am here to tell you how to setup YUM server. I hope that you know what is a YUM server, if not no worries. A YUM server is rpms/packages manager which resolves the various dependencies needed by the packages and installs the software. For further details on YUM server you can google it.....:)

We can setup our YUM Server on any Distribution that supports it. I am using Fedora13 to setup a YUM server for the fedora13 itself. Same procedure will also be useful for RHEL(Redhat Enterprize Linux) users. They can use this tutorial to setup YUM server for RHEL.

Prerequisites:
- A fedora13 ISO or DVD
- A fedora13 Linux Box installed

Steps to go:

1) First of all mount the DVD of the Fedora 13 or fedora13 ISO if you have ISO.
(# mount -o loop Fedora13.iso /mnt) For ISO users

2) Then move in the media i.e. DVD or the ISO.
# cd /media/fedora13-DVD
or
# cd /mnt (for iso users if they mounted it under /mnt or put the custom location if you are using another mount point)

3) Now cd into the directory Packages, this directory contains all the official packages for the Fedora13 that are included in the fedora13.
# cd Packages

4) For creating a YUM server we can either use HTTP or FTP. In my case i am using FTP. So install the rpm package "vsftpd" from the directory Packages.
# rpm -ivh vsftpd-2.2.2-3.fc13.i686

Also install the package "createrepo"
# rpm -ivh createrepo-0.9.8-4.fc13.noarch


5) Now, Copy the Packages directory to the location /var/ftp/pub
# cp -rfv Packages /var/ftp/pub

6) Now copy the file from the DVD (or /mnt in case of ISO) named as "fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml" to the location /var/ftp/pub/Packages
# cp fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml /var/ftp/pub/Packages

7) Now cd into the directory /var/ftp/pub/Packages and create repo with the following command:
# cd /var/ftp/pub/Packages
# createrepo -vg fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml .
( remember the "." in the last it represents the current directory)

8) Now create the repo file for the YUM Server. I am naming the as "server.repo", you can have any name you want to this file but file extension should be ".repo" only.
# vim /etc/yum.repo.d/server.repo
[Server]
name=YUM Server
baseurl=file:///var/ftp/pub/Packages
gpgcheck=0
enabled=1


Remember I have disabled gpgcheck since i am not using the gpgkeys. If you want to use the gpgcheck you can use.

Now just make YUM Clients and have fun installing applications. If you are installing applications on the same Box on which you have configured the YUM Server then you don't need to create a client repo file.

For other systems you have to create a client repo file in /etc/yum.repo.d as:
# vim /etc/yum.repo.d/server.repo
[Client]
name=YUM Client
baseurl=ftp://youripaddress/pub/Packages
gpgcheck=0
enabled=1



YUM server is ready to rock...:) have fun......Enjoy....:)

No comments:

Post a Comment