Friday, April 12, 2013

Create Local/Network Repo in Scientific Linux 6.3


mount /dev/sr0 /mnt/ 

install vsftpd package, so that we can use this as a FTP server to share our repository in the client systems.

Change to the directory where you mounted Scientific Linux DVD. In our example we have mounted the DVD

DVD in /mnt directory.

    # cd /mnt/Packages
    # rpm -ivh vsftpd-2.2.2-11.el6.i686.rpm


Start the FTP Service:

    # service vsftpd start

install createrepo package if it is not installed. This is package is used to create our local 

repository.

    # rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm

Oops!! It shows us the dependency problem. Let us the install missing dependencies first:

    # rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm 

Then install the another one:

    # rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

Now install the createrepo package:

Create a folder called yumserver (You can use your own) in /var/ftp/pub directory to save 

all the packages from the Scientific Linux DVD. Copy all the files in the Packages folder from the DVD to 

/var/ftp/pub/yumserver folder:

    # mkdir /var/ftp/pub/yumserver
    # cp -ar *.* /var/ftp/pub/yumserver


it will take a while to copy all the packages in the DVD. Please be patient. After all packages are copied, create a repo file called yumserver.repo in /etc/yum.repos.d/ directory.

    # nano /etc/yum.repos.d/yumserver.repo

[localyumserver]
name="my local repository"
baseurl=file:///var/ftp/pub/yumserver
gpgcheck=0
enabled=1


Where,
[localyumserver] ==> Name of the Local Repository.
comment ==> Information about the Repository.
baseurl ==> Path of the Repository (i.e where we had copied the contents from Scientific Linux DVD)
gpgcheck ==> Authentication of the Repository, which is disabled in our case.

Now it is time to create our repository. Enter the following command in the Terminal:

    # createrepo -v /var/ftp/pub/yumserver

Now the local YUM repository creation process will begin. 

Note: Delete or rename all the other repo files except the newly created repo file i.e in our 

example it is localyumserver.repo. 
Next update the repository:

        yum clean all
        yum update

You’re done now.

Client side configuration:

Create a repo file in your client system as mentioned above in the /etc/yum.repos.d/ directory 

and remove or rename the existing repositories. Then modify the baseurl as mentioned below:

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://myserver.domain.com/pub/yumserver
gpgcheck=0
enabled=1 

    (or)

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://192.168.10.101/pub/yumserver
gpgcheck=0
enabled=1


source:http://ostechnix.wordpress.com/2013/01/05/setup-local-yum-server-in-centos-6-x-rhel-6-x-scientific-linux-6-x/ 

No comments:

Post a Comment