How to install multiple versions of the same package in Gentoo?

6,921

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.

Share:
6,921

Related videos on Youtube

Laurent Pireyn
Author by

Laurent Pireyn

Updated on September 18, 2022

Comments

  • Laurent Pireyn
    Laurent Pireyn over 1 year

    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?

    • Keith
      Keith almost 13 years
      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.
    • HedgeMage
      HedgeMage almost 13 years
      @Keith - That's the right answer, why not post it as an answer?
    • Laurent Pireyn
      Laurent Pireyn almost 13 years
      @Keith: If it's indeed the only way to do it, then post it as an answer and I will gladly accept it.
  • Stefano
    Stefano about 11 years
    A little hint towards a pragmatical way to use slots would help newbies :)