Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

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.

share|improve this answer
    
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 3 at 4: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 3 at 17:44
up vote 0 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.