Search This Blog


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
    name=CentOS repository in Sandvine Waterloo LAB
  3. Verify you can connect the repo
  4. yum repolist

No comments:

Post a Comment