0

I have an EL5 machine. On this host I would like to mirror a Puppet repository for EL6 rpms. How can I mirror an EL6 or Fedora repository on an EL5 host?

I am using reposync because I only need the newest packages available on the repo, not the entire repository.

My .repo file contains this:

# cat puppetlabs.repo.el6
[main]
# Override default releasever, per `man yum.conf`
releasever=6
# Try distroverpkg instead?
distroverpkg=6

[puppetlabs-products]
name=Puppet Labs Products El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/products/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0=1
gpgcheck=1

My command line is as follows. As you can see, reposync is affixing 'el5' to the URL when I need it to say 'el6'.

# lsb_release -r
Release:        5.10
# reposync --newest-only --repoid=puppetlabs-products --config=puppetlabs.repo.el6 --urls
http://yum.puppetlabs.com/el/6/products/x86_64/facter-1.6.6-1.el5.noarch.rpm
http://yum.puppetlabs.com/el/6/products/x86_64/facter-2.0.1-1.el5.x86_64.rpm
http://yum.puppetlabs.com/el/6/products/x86_64/hiera-1.3.2-1.el5.noarch.rpm
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186

2 Answers2

1

I'm guessing the machine you're using also has the puppetlabs repo installed in /etc/yum.repos.d/? If you remove it from there (and flush the yum cache), do you still see this issue?

I would suspect you're going to want to give reposync an entirely new yum.conf (via --config), specifying a different cache directory then the normal system one.

devicenull
  • 5,622
  • 1
  • 26
  • 31
  • I removed the pre-existing puppetlabs repo from `/etc/yum.repos.d/` but I did not flush the yum cache. I'll try that. I did try `--config` but I did not try a separate cache. – Stefan Lasiewski Apr 03 '14 at 04:59
  • I did `yum clean all` and hardcoded `cachedir=/tmp/test/cache/` to the `[main]` section of my conf file. It still doesn't work. – Stefan Lasiewski Apr 03 '14 at 17:44
0

Thanks to @devicenull for leading me down the right path. I got the following to work. I had to hardcode distroverpkg as well as the cachedir and persistdir.

Here is my repo file:

# cat puppetlabs.repo.el6

# NOTE: This [main] section is required to workaround yum wierdness when we mirror distroverpkg=6 from an el5 host
[main]
distroverpkg=6
cachedir=/var/cache/puppetlabsmirror.el6/cache/
persistdir=/var/cache/puppetlabsmirror.el6/var
keepcache=0

[puppetlabs-products]
name=Puppet Labs Products El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/products/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

And now the following command works fine:

# reposync --config=puppetlabs.repo.el6 --repoid=puppetlabs-products --newest-only --urls    http://yum.puppetlabs.com/el/6/products/x86_64/facter-1.6.7-1.el6.noarch.rpm
http://yum.puppetlabs.com/el/6/products/x86_64/facter-2.0.1-1.el6.x86_64.rpm
http://yum.puppetlabs.com/el/6/products/x86_64/hiera-1.3.2-1.el6.noarch.rpm
http://yum.puppetlabs.com/el/6/products/x86_64/hiera-puppet-1.0.0-1.el6.noarch.rpm
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186