Search This Blog

2013-05-08

Creating a Local CentOS Repo

Setting Up the Repo Location

  1. Make a directory in which you will store the RPMs from the CentOS disc
  2. mkdir -p /rpm-packages
  3. Copy the disk contents to that directory
  4. rsync -avHx /rpm-packages-source /rpm-packages-destination
  5. Ensure your destination directory is writable
  6. chmod 666 /rpm-packages-destination

Configuring the CentOS Client

Creating the Repo Files

  1. Install createrepo in order to create repo data
  2. yum -y install createrepo
  3. Mount the rpm packages from the CentOS disc so we can create some repo files
  4. mount /rpm-packages /mnt/rpm-local-mount
  5. Create the repo files using the installed createrepo command
  6. createrepo -v /mnt/rpm-local-mount --outputdir /home/ 
  7. Copy the repo data you created to the /repo-pacakages-destination
  8. rsync -avHx /home/repodata root@repo-server:/rpm-packages-destination

Creating the repo file and verifying

  1. Create the local repo file
  2. vi /etc/yum.repos.d/local.repo
    [centos-disc]
    name=CentOS repository in Sandvine Waterloo LAB
    baseurl=ftp://repo-server/rpm-packages-destination
    enabled=1
    protect=0
    gpgcheck=0
    
  3. Verify you can connect the repo
  4. yum repolist
References:
http://linuxchallenges.blogspot.ca/2012/03/local-yum-repository-on-red-hat-6centos.html
http://www.bestdesigns.co.in/blog/create-yum-repository-local-machine
http://howtoinstallit.wordpress.com/2013/04/26/how-to-create-local-yum-repository-in-centos-6-4/
http://www.planet-heisel.de/joomla/index.php/software-tools/87-software/codeschnipsel/93-repo-centos63
http://boxgrinder.org/tutorials/how-to-use-local-repository/

No comments:

Post a Comment