9

I would like to install two (or more) versions of the same packages on my Gentoo system. I know for sure there won't be any file clash, since there very few files installed and each of them is named after the version.

I know about slots, but these are specified in the ebuild files, and let's assume I don't want to edit any ebuild file for several reasons.

I would like the installed versions to be part of the world package, so they can be reinstalled or uninstalled as usual.

Is there a way to install multiple versions of the same package? Do you know of some Portage tricks to achieve that?

  • That's what slots are for. If the package is not slotted then the only thing I can think of is to create a personal overlay and a new package/ebuild that is slotted. – Keith May 2 '11 at 1:11
  • @Keith - That's the right answer, why not post it as an answer? – HedgeMage May 2 '11 at 2:07
  • @Keith: If it's indeed the only way to do it, then post it as an answer and I will gladly accept it. – Laurent Pireyn May 2 '11 at 10:56
9

That's what slots are for. If the package is not slotted then the only thing I can think of is to create a personal overlay and a new package/ebuild that is slotted.

  • 2
    A little hint towards a pragmatical way to use slots would help newbies :) – Stefano Apr 13 '13 at 14:20
1

I think in theory you could do something silly like:

$ ROOT=~/package-1.0 emerge =package-1

But basically all non-overlay stuff is highly subject to some additional limitations and requirements about which there is not that much information.

1

What you might try (I'm not sure if it works as expected) is to use /etc/portage/env to set the SLOT of particular package versions. It might not work because of metadata caching though. Even if it does work this is a cludge and may result in unexpected behaviour. As always, if it breaks, you get to keep the pieces.

1

This is an old question, but still valid, and no one has proposed the following simple approach:

If you don't want to create slots, and you know the files don't collide, simply create a new ebuild in your local overlay (after setting the local overlay up in make.conf) and name it differently. Perhaps something like 'mypkg.ebuild'. There's no law that states the ebuild name and the files it installs have to share the same names. Copy portage's pkg.ebuild file to /usr/local/portage/app-class/mypkg-newversion.ebuild, make the necessary changes for the new version, ebuild and emerge it.

Keep in mind you won't be able to use some of the predefined variable names (${P} et al) when fetching the sources.

0

Another potential thing to explore is Gentoo Prefix

Which might be a viable alternative if you don't mind maintaining 2 ecosystems of Gentoo in order to provide the "alternative" package.

This is essentially creating a "sub-space" for a given project scope, and then using Gentoo differently in that project scope.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.