[lug] Private yum install tree?

David L. Anselmi anselmi at anselmi.us
Fri Dec 28 22:45:42 MST 2012


Aaron Nichols wrote:
> On Fri, Dec 28, 2012 at 2:43 PM, Steve Sullivan<sullivan at mathcom.com>wrote:
>
>> Is there a way to have yum use a private repository,
>> and install to a private directory tree?
>
> Two separate problems - but related. Here's my $.02
>
> 1) For yum to use a private repository, try building your own yum
> configuration and use the -c argument.

yum will use your private repository, you just have to tell it about it.  I expect there's a way to 
specify the config yum will use.  But you only need that if you are using rpms you built yourself. 
If you can use the stock ones this isn't necessary.

> The problem you're going to have though, if you aren't root, is that you can't write to the RPM
> database - so it's doubtful yum or rpm will work for you. I'm not aware of a way around that.

I've done this.  I don't remember if you tell rpm to use a special config or a special database but 
you can.  But try to make sure your careful that one database covers one set of installed files and 
they don't overlap.  And of course if you use your own db it won't know about what's already 
installed so dependencies will be a problem.

This isn't the sort of thing package managers were designed for so you might look at something other 
than rpm.  dpkg isn't necessarily any better but Debian has tools to build a chroot that you can use 
for build packages against a certain set of installed software.  You wouldn't be able to use a 
chroot per se, but those tools might get things installed in your own directory at least.

You could also look at nix--not sure it solves this problem but it's rather different than dpkg and 
rpm so it's worth a look.  And various other niche package managers might be able to do this as a 
way to coexist with the mainstream ones.

Dave



More information about the LUG mailing list