Koozali.org: home of the SME Server

Custom Yum repository configuration suggestion

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Custom Yum repository configuration suggestion
« on: October 23, 2011, 06:08:35 PM »
I've always had trouble keeping clear records of what custom software I have installed from what yum repository, leaving me sometimes in trouble managing my updates.

I was recently working on a problem involving a custom repo, and got the following suggestion:
Instead of listing what you exclude, it might be better to use:

IncludePkgs pcre
...so you don't inadvertently install something else from that repo

and

status enabled
...so you get notified of updates/fixes.
This solution solves the problem of keeping my custom software updated, but makes it hard to install anything else from the same repo, as there is no command-line option for yum to ignore the 'IncludePkgs' directive.

This started me thinking about what it would take to both allow future installs and provide automatic update notifications for packages installed from custom repos.

I've come up with a proposed solution:
  • Modify the standard custom repo configuration instructions to create two entries for each repo:
    • one for installing new software
      • status = 'disabled'
      • using 'Exclude' to keep your SME safe)
    • another for monitoring updates to installed software
      • named <reponame>-installed
      • status = 'enabled'
      • using 'IncludePkgs' to list include what you've installed from that repo
      • starting with 'IncludePkgs = -none-' to avoid unexpected updates
  • Update wiki instructions to tell users how to keep the <repo>-installed settings up-to-date
Under this scenario, we would edit the repo setup instructions for all repos.  As an example, the instructions to setup the dag repository on SME 8b6 would look like this:
Code: [Select]
/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL5' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

/sbin/e-smith/db yum_repositories set dag-installed repository \
Name 'Dag - EL5 - Installed Packages' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
IncludePkgs '-none-' \
status enabled

And wiki pages instructing users to install software from a custom repo would include instructions on updating the setting for 'IncludePkgs' for <repo>-installed:
Code: [Select]
db yum_repositories setprop dag-installed IncludePkgs "`db yum_repositories getprop dag-installed IncludePkgs` <newpkg>"
Pros:
  • Custom-installed packages will be included in update checks
  • If 'IncludePkgs' is always updated, admins will always have a record of what they have installed from what repo
  • works exactly like the current situation if admins choose *not* to update 'InstallPkgs'
  • Updates are as simple as 'yum update'
Cons:
  • Requires an extra step after each install, to keep 'InstallPkgs' up-to-date
  • ???

Comments?

Offline gregswallow

  • *
  • 651
  • +1/-0
Re: Custom Yum repository configuration suggestion
« Reply #1 on: October 24, 2011, 10:18:49 AM »
Have a repo named 'smecontribs-dag'  and set IncludePkgs pcre and status enabled.  There is no way to install anything but pcre from that repo configured like that.  This is what I would do for any contribs you have locally that are not in the smecontribs repository.

Have another repo named 'dag' and have it disabled.  Exclude any rpms that SME customizes if you want to be a bit safer, but you should know never to do yum --enablerepo=* update anyways....  That repo should just be used to test what rpms a new contrib needed, something like "yum --enablerepo=dag localinstall smeserver-xxx".

PS - I don't think you can have Exclude and IncludePkgs settings in the same repo.
« Last Edit: October 24, 2011, 10:22:12 AM by gregswallow »

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Custom Yum repository configuration suggestion
« Reply #2 on: October 24, 2011, 12:42:43 PM »
I like 'smecontribs-<reponame>', and you're right - 'Exclude' has no effect if 'IncludePkgs' is set.

My question is really about whether I should update the 'Repository' category page (and all of the repo pages, and possibly the repo template, and the 'howto' and 'contrib' pages that mention '--enablerepo=...') with this suggestion?

Offline gregswallow

  • *
  • 651
  • +1/-0
Re: Custom Yum repository configuration suggestion
« Reply #3 on: October 24, 2011, 09:57:48 PM »
My question is really about whether I should update the 'Repository' category page (and all of the repo pages, and possibly the repo template, and the 'howto' and 'contrib' pages that mention '--enablerepo=...') with this suggestion?

I don't think so.  It's not how we want development to go.  Contribs should go in smecontribs CVS and be built on the build server and their depedencies from 3rd part repo's added to the smecontribs repository as well.  This is a good thing to do for your own personal use though

I suggested some reorganization of the Contrib category of the wiki - http://bugs.contribs.org/show_bug.cgi?id=6749 - So this would not be relevant for contribs (proper contribs that are in CVS and the smecontribs repo and have a component in the bug tracker), as their dependencies can also be put in the smecontribs repo.  As you can see in bug http://bugs.contribs.org/show_bug.cgi?id=6759#c10 as of very recently all the corresponding EL5/SME8 dependancies are in smecontribs for all but a couple of the SME7 smecontribs smesercer-xxx rpms.