1

I've tried to set up a local repo on a server (alecto) using reposync. This part seems to go OK and the the target directory (/repo) gets populated.

I did this so I could update multiple VMs running CentOS without hammering my Internet connection.

The problem is that when using 'yum update' on the VMs, it fails on most (not all) packages, apparently looking for older versions of that package than is installed in the /repo directory. For example, it looks to install zlib-1.2.7-17 when the version in /repo is zlib-1.2.7-18. I have no idea where it gets the idea that the -17 version should be used.

There is only one repo defined in the VM's /etc/yum.repos.d directory - alecto.repo and that contains:

[alecto]
name=Local network repo on Alecto
baseurl=ftp://192.168.1.110/
enabled=1
gpgcheck=0

It's not the FTP setup - some installations work (eg yum install pigz) and it's possible that they work because their version number doesn't change very often.

I've run createrepo on all the reposync'ed directories and I have cleared out all yum caches on the VM.

My question is: What the heck is going on? Failing that: where does yum get the version numbers of what it thinks it needs to install?

I have been beating my head against a wall for two days now and could really use some help.

  • On the VMs you ran yum clean all? – slm Jan 7 at 3:03
0

There's a couple of Q&A's on access.redhat.com that show the following setup:

For the VMs

$ cat /etc/yum.repos.d/local.repo
[RHEL7]
name=Red Hat Enterprise Linux $releasever - $basearch
baseurl=ftp://<ip_address>/<somedirectory>/
enabled=1
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

You'd then run the following:

$ sudo yum clean all
$ sudo yum repolist
[...]
RHEL7             | 1.5 kB     00:00     
RHEL7/primary     | 920 kB     00:00     
RHEL7                               3285/3285

repo id          repo name       status

RHEL7 Red Hat Enterprise Linux 6Server - x86_64     3,285
            repolist: 3,285

You can then run on the VMs:

$ sudo yum update

NOTE1: This is the URL but it requires an account to see it - https://access.redhat.com/solutions/3187892.

The Q&A also referenced this video on Youtube which anyone can view titled:Creating a Local Repository and Sharing With Offline Systems.

NOTE2: You do not show your reposync method for pulling the repo down, but I suspect that the method you used is the root of your issue. Take a look at the video, it shows how to properly perform a reposync.

  • I have followed the tutorials and some of it seems to work. The command I use to set up /reo is 'reposync -g -l -d -n -p /repo createrepo /repo' – cassini232 Jan 7 at 11:40
  • It seems the basic setup works, but I still have the problem of the differing package versions. Where is the client yum getting a version of the package that doesn't even exist in the /repo directory? – cassini232 Jan 7 at 11:43
  • @cassini232 - it can only get it from 2 places, either a errant repo or a cache. You could try running yum with more verbose logging to see where it's getting this package. – slm Jan 7 at 14:12
0

Solved it!

I was thrown by the fact that issuing the reposync command used alecto's own yum.repos.d to populate /repo. Somehow I thought the same would apply to the client - it doesn't, so I can't just specify /repo as the start point on the client. This means that alecto.repo goes from looking like this

[alecto]
name=Local network repo on Alecto
baseurl=ftp://192.168.1.110/
enabled=1
gpgcheck=0

to this

[base]
name=Local network repo on Alecto - base
baseurl=ftp://192.168.1.110/base/
enabled=1
gpgcheck=0

[epel]
name=Local network repo on Alecto - epel
baseurl=ftp://192.168.1.110/epel/
enabled=1
gpgcheck=0

etc...

I still don't understand where the -17 version of zlib came from, but that's something I'll look into when I have more time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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