Using the install DVD as a repository for yum

At work we use Red Hat Enterprise Linux and we don’t want to use the online repositories. (hmm.. set up a central repository of sorts?) Anyways, I would follow this guide (plus the step in the comments to import GPG keys), but we image these drives via FTP and don’t want to keep copies of ISOs (we do x64 and 32) on the hard drive’s filesystems that would end up getting backed up (and doubling the image size). You can use the same method to create a repository with the CD and not an ISO file:

  1. Create a mountpoint and mount the DVD
  2. mkdir -p /mnt/rhel/dvd
    mount /dev/cdrom /mnt/rhel/dvd

  3. Install createrepo somehow
  4. rpm -i createrepo.rpm

  5. Make a repository in the directory above your mountpoint
  6. cd /mnt/rhel/
    createrepo .

  7. Clean the repo (I’m not sure if this is necessary)
  8. yum clean all

  9. Add your new repo to yum’s repo list.. edit /etc/yum.repos.d/dvd.repo with:
  10. [dvd]
    name=dvd
    baseurl=file:///mnt/rhel
    enabled=1

  11. Import the GPG keys for the DVD
  12. rpm –import /mnt/rhel/dvd/RPM-GPG-KEY

I am writing this from memory, so no guarantees on correctness :)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: