0

I'm having trouble with mrepo on a RHEL 6 system, trying to mirror a RHEL 5 repo.

Running mrepo -uvvvv will update all the packages but it won't create the repdata directory. You have to specify -s sha (or --checksum sha) since yum on RHEL 5 doesn't use the sha256 that later versions do.

This is my mrepo.conf file

[main]
srcdir = /opt/mrepo
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386 x86_64

mailto = root@localhost
smtp-server = localhost

rhnlogin = un:pw

rhnget-download-all = yes

[5Server]
name = Red Hat Enterprise Server $release ($arch)
release = 5
arch = x86_64
metadata = repomd
updates = rhns:///rhel-$arch-server-$release
createrepo-options = -s sha

According to the documents, I'm supposed to be able to use createrepo-options to pass options to the createrepo command. However when I run the mrepo command I get the following snippet

Setting option arch in section [6Server] to: x86_64
5Server-x86_64: Updating Red Hat Enterprise Server 5 (x86_64)
5Server-x86_64: Mirror packages from -s to /opt/mrepo/5Server-x86_64/createrepo-options Ignoring mirror action for type
5Server-x86_64: Mirror packages from sha to /opt/mrepo/5Server-x86_64/createrepo-options Ignoring mirror action for type
5Server-x86_64: Mirror packages from rhns:///rhel-x86_64-server-5 to /opt/mrepo/5Server-x86_64/updates

I have no idea where it's getting "Mirror option type" from.

Any suggestions would be gratefully received and tried (except rm -rf!).

I looked into reposync but that will only work with the same revision of RHEL. You can't use RHEL 6 and download RHEL 5 with it.

nelgin
  • 89
  • 1
  • 3
  • try just generating the repo like this: mrepo -gvv 5server – natxo asenjo Aug 05 '16 at 08:50
  • I tried that but it's generating sha256 rather than sha checksums. There seems to be an issue with the createrepo-options. – nelgin Aug 05 '16 at 19:10
  • and if you run createrepo manually? – natxo asenjo Aug 05 '16 at 20:02
  • If I run createrepo manually then I would have to use --checksum sar as a command line option. This is what createrepo-options is supposed to do but instead I'm getting those strange errors 5Server-x86_64: Mirror packages from -s to /opt/mrepo/5Server-x86_64/createrepo-options Ignoring mirror action for type I reformatted the original post since it didn't show the messages clearly. The whole point is that mrepo should download the files and create the repodata files in one go. It's either broken or I've misconfigured something. – nelgin Aug 05 '16 at 23:24
  • I can reproduce, it looks like a bug. Right now your best bet (as mrepo looks not really developped now) would be to use reposync + createrepo manually, switch to other repo mirroring tool like pulp, or try fixing the problem in the python script yourself. – natxo asenjo Aug 06 '16 at 06:36
  • just adding some more info, createrepo-options are just read from section [main], so that is what is going wrong. You could copy the mrepo executable and try modifying so that it does not stop just in main but uses the other sections as well. It is doable, but will require you to hack some python. – natxo asenjo Aug 06 '16 at 07:00
  • @natxo - As started, you cannot use reposync on a RHEL 6 server and donwload RHEL 5 packages. If you can then you're a better man than I am. – nelgin Aug 07 '16 at 07:56
  • I'll try adding the createrepo-options in main but that seems to defeat the fact that the options can be different for different repos. Looks like I'll have to use multiple .conf files, one for RHEL5 and one for RHEL6. I'll give it a try. – nelgin Aug 07 '16 at 07:57
  • I do not know with RHEL (no access to that right now) but I just tested with fedora 24 and I can reposync centos 5, no problem. Just used the -c to point to to a custom repo file – natxo asenjo Aug 07 '16 at 13:14
  • but I see what you mean (https://access.redhat.com/solutions/23016), you can only download from the subscribed channels, so that is annoying. – natxo asenjo Aug 07 '16 at 20:31
  • In the end I had to create 3 separate repos. 1 for 5Server-i386 because I only download the latest packages, one for 5Server-x86_64 because I get all the packages but have to create sha checksums, and then one for 6Server-x86_64 with all the packages and the default sha256 checksum. Since you pointed me in the right direction, if you'd like to propose the comment you listed as an answer then I'd be happy to accept it. – nelgin Aug 09 '16 at 02:28
  • to be honest I am not entirely sure what you have done ;-). Do you have 3 hosts doing eacht reposync (one per arch, rhel version)? Glad you found a solution, that was the whole point. – natxo asenjo Aug 09 '16 at 11:27
  • I have 1 host which has 3 cronjobs in /etc/cron.d/mrepo each with a -c option to use a different configuration file. We have different requirements for each release and architecture. As I said, 5Server-i386 will only have the latest packages where was 5Server-x86_64 and 6Server-x86_64 get all the packages, but for the 5Server releases I have to use createrepo-options to set --checksum sha otherwise the repodata checksums are created sha256 which the older yum/rpm in RHEL 5 can't handle. It's a pain, but it's working. – nelgin Aug 10 '16 at 16:40

0 Answers0