Monday, September 26, 2011

ReCollecting the FileProvides

I use APT for RPMs, as it's the most versatile tool out there.  Some folks don't seem to understand that APT was ported for RPMs about a decade ago, and those using Yum for their RPM management are encouraged to do so, lest their horizons grow too broad.  The truly genius folks at Conectiva used APT to great benefit, and allowed massive flexibility;  upgrading in-place over a major release was a possible, easy and well-tested procedure, as I recall.  But this isn't for the Apt-RPM genius so recently localized at Conectiva and now lost to the rest of the world.

Lately there's been another change to the repository format and layout as used by YUM;  this is nothing new, as many open-source de-facto standards are developed and grow in the same kind of seeming vacuum, and the gaijin must adapt.  If you're suffering as I was, your apt-get update invocations will look like this:
E: Error occured while processing sec (CollectFileProvides) E: Problem with MergeFileProvides /var/lib/apt/lists/archive_cobbler_repo%5fmirror_epel5-i386_repodata_277d21a2341fe766d0daff22b2846905517bcd71-primary.sqlite
I'm using Cobbler to mirror many, many repos locally; almost anywhere I have more than one machine.  The update to the createrepo invocation will either come from /etc/cobbler/settings or the createrepo flags in a particular repository item.

Here's my change:
--- /etc/cobbler/settings~ 2011-09-23 07:03:38.000000000 -0700 +++ /etc/cobbler/settings 2011-09-26 14:24:32.000000000 -0700 @@ -58,7 +58,7 @@ # enables working with Fedora repos from F11/F12 from EL-4 or # EL-5 without python-hashlib installed (which is not available # on EL-4) -createrepo_flags: "-c cache -s sha -C --update" +createrepo_flags: "-q -c cache -s sha --update -d" # if no kickstart is specified to profile add, use this template default_kickstart: /var/lib/cobbler/kickstarts/default.ks
You will need to adjust to suit, as the patch will not apply cleanly unless you've been mucking about there already, but take the patch and make yours match the result.  Restart cobbler when you're done and your repos will be updating madly as expected.

As always, sorry if the Blogspot editor butchers my blockquotes.

Labels: , , , , , ,