Log in

Not putting all your pkgs in one repo. (yum edition) - James Antill

Aug. 12th, 2008

11:03 pm - Not putting all your pkgs in one repo. (yum edition)

Previous Entry Share Next Entry

As you create packages for private use, the question will eventually come up "where do I put these". The choice is obvious for the first package, just create a repo. (using createrepo -d) and distribute the my.repo file. However as you create more packages the answer should expand to having multiple repos. Different package managers have a different ideas about what should go inside a single repository, and the corollary to that is if you take the "best practice" for some other package manager and apply it to yum the results might not be all they could be. This posting will try and lay out the best practises for yum (3.2.z), and some of the reasons for them.

Probably the most common problem I see is people who think "yum-priorities" and/or "yum-versionlock" is a good solution to their problem, it is not. Another warning sign is the use of exclude and/or includepkgs, which are just a faster version of the above. While those plugins adds certain features that make certain things possible, needing those features is always a sign that you've got the separation of packages into repositories wrong (or something is just plain broken).

One of the least worst problems is they are not scalable, the basic implementation gets all the "good" packages and then excludes all the "bad" packages. However the real problems start due to the shortcuts they take so they can be faster, for instance if pkgA depends on pkgB and only pkgB is a "good" / "bad" package then pkgA will now either having a missing dependency or will end up running with something it wasn't built with/for. As more packages are added to the repositories it's more likely problems will arise.

The correct solution to problems that suggest yum-priorities, having packages that are an extension of an upstream and packages that override others in the upstream, is to split your one repository into more than one. Here is a quick list of reasons you'd want more than one repository:

One of the main things that isn't listed above is "security updates" vs. "bugfix updates", this type of update is often split in other package managers. However in yum you should just create (or generate) updateinfo.xml data for the repository, and then use the yum-security plugin to select security updates (or fixes for specific CVE/BZs/etc.)