[CentOS] other repositories question

Johnny Hughes mailing-lists at hughesjr.com
Mon Nov 7 12:57:58 UTC 2005

On Mon, 2005-11-07 at 11:56 +0100, dan1 wrote:
> >On Mon, 2005-11-07 at 00:14 +0100, dan1 wrote:
> >> Hello.
> >>
> >> I would like to know how other repositories than the official ones for
> >> CentOS 4 affect an update of a package if a package is present in both
> >> repositories.
> >> Will yum install the package that it finds having the highest version
> >> number ? and if so, is there a mean to tell yum that we would like to
> >> keep the preference to one repository instead of the highest version
> >> number on a possibly other repository ?
> >>
> >> I ask that because I realise that having multiple repositories added
> >> to yum might mix up things if the packages placed there are compiled
> >> for newer versions, and even possibly create another system than
> >> CentOS by updating several main common packages. That would do
> >> something between a CentOS and a cAos distribution, is that right ?
> >
> >Yes, if you have a newer version in a repository and you add that full
> >repo, the newest version will get installed.
> >
> >But with yum > 2.2.x there is a feature called "includepkgs="
> >>
> >> For example, I would like to use Dag Wieers' repos, but I am in fear
> >> that some mix up might happen if there are several same packages with
> >> different versions than the official CentOS ones (and is it possible
> >> to have same packages there? ).
> >
> >With "includepkgs=" you can make an entry like this in the definition
> >for the Dag repo:
> >
> >includepkgs=rsync iptraf
> >
> >It would then only look at rsync and iptraf from dags repo
> >
> >See this link for an in depth review of yum:
> >
> >http://fedora.redhat.com/docs/yum/index.html
> Hello, Johnny.
> Thank you for that useful information.
> Do you know if there is a list of packages that are the same that the 
> official ones on the Dag repo, so that I might put them in the 'exclude' 
> list on the official repo ?
> My goal is to take all packages by default from the official centOS 
> repositories, but all other packages that are not present there but present 
> in Dag wieers' repo should be accessible and updatable.
> Isn't there a way to tell that to yum with a simple command, so that if Dag 
> is adding a package which is already present in the official repo it would 
> not be updated from there but still from the official centos repo? With the 
> 'includepkgs' method we should list all packages that are not present in the 
> official repo and also as soon as Dag adds a new package it would not be 
> accessible apart if we periodically update a list that we must create 
> ourselves and that would be not a clean solution.
> Is my assumption correct ?

That is correct.  You must currently maintain a separate list.

> If yes, then a tag like 'pkgsauthority=yes' in the repository options could 
> do the trick. That would tell yum that it must take all packages it can find 
> in that repo as the official ones, even if there is another in some other 
> repo with a higher version. However, any package not listed here but present 
> in another one would be used there for update or install.

That would be, in my opinion, a very good thing to have.  Or something
like Repo pinning.  That does not exist in the default yum.

Those things would bring their own problems, because there would be
items in the Dag repo (let's say "package B" that REQUIRE a newer
version of "package A" (which is contained in the CentOS repo).  This
would cause a dependency problem if trying to install or upgrade
"Package B".

> In my example, I would place that tag in the centos repositories.
> That way, we could really ensure that we have a clean, not modified, 
> official CentOS distribution server running, and all very useful Dag's 
> packages would still be available.
> My concern is that with any other repository, people would place there the 
> same packages and that this particular version of the package would break up 
> something. This is to avoid having a cAos like system and still keep the 
> versionning from RHEL safely.
> What do you think ?

There is a package called yum-utils that has a plugin called

I have not used this plugin, so I can not vouch for it's ability.

You can download the latest yum-utils .src.rpm here:


(currently the latest one is yum-utils-0.3.1-1.src.rpm)

Then if you have the packages necessary to build packages installed, you
can rebuild RPMS you can issue the command:

rpmbuild --rebuild  yum-utils-0.3.1-1.src.rpm

I am not currently maintaining yum-utils for centos, but you can
download the latest RPM (rather than building it yourself) from me here:


and install it via the command:

yum install yum-utils-0.3.1-1.src.rpm

After it is installed, it seems that you must make some directories at




The you need to edit the file /etc/yum.conf and add the following line:



Then copy the file:




and then copy the file:




Once these files are in place, you would add the following to each repo
that you want to protect:


(I would recommend in [base], [updates], [extras], [addons] sections
of /etc/yum.repos.d/CentOS-Base.repo)


The way I read the info on the plugin, that should mean that DAG (or
other repos) can not update the protected ones.

This seems to work OK for me when using the dag repo in my setup and the
protectbase plugin, I have no idea how well it works for other people.

Johnny Hughes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20051107/e32d2639/attachment.sig>

More information about the CentOS mailing list