HOWTO: Safely mix Entropy and Portage

From Sabayon Wiki
Revision as of 23:37, 24 April 2014 by Stupot (Talk | contribs) (Final Note)

Jump to: navigation, search
i18n: en tr

Mixing Portage and Entropy Safely

Rules and Knowledge

Portage (emerge) is not the primary package manager for Sabayon; this article is for advanced users only. In other words, if this fails for you, it is your fault. You have been warned.

Mixing Portage and Entropy is not recommended without extensive knowledge of both package managers. It is recommended that you pick one or the other for maintaining your system. As every package on Sabayon comes from either Gentoo proper or from Sabayon's Gentoo overlay, using portage is generally considered unnecessary, there are of course always corner cases.

First of all, when mixing Portage and Entropy, never use Portage to update Portage. Sabayon uses a version of Portage that is hard masked in Portage. This means that you will actually be DOWNGRADING, not upgrading portage. This one simple mistake can completely break your installation due to differing dependencies at the system level. If you are going to mix and match, ALWAYS use Entropy to upgrade portage.

the command 'emerge portage' should never be issued when mixing and matching package managers

So, how do we get the packages we want installed the way we want them? That is actually fairly easy and it is a two-step process. For each package that you want to install:

# nano -w /etc/portage/package.use/00-sabayon.package.use

Add each package there with the USE flags that you want it to have, including the -USE flags for the flags you don't want it to have that may get added by the make.conf. This overrides the make.conf for that particular package. If your package or USE flags requires new dependencies with specific settings, you will need to add those in here as well. A caveat here, avoid system packages at all costs. It is best to use Entropy to meet all dependencies for any package, prior to emerging the actual package. If it is core to the system either live with it or convert your entire system to portage only.

In the case that package.use is a folder, you can edit the file /etc/portage/package.use/00-sabayon.package.use/00-sabayon.package.use, or create another file like 01-mypackages.use inside that folder.

Next we need to keep Entropy from messing with our new packages. So you will need to tell Entropy to ignore these packages. This is done by:

# nano -w /etc/entropy/packages/package.mask

You need to make sure that you keep back ups of each of these files every time you edit them. Entropy has been known to insert new versions of these files from time to time thereby destroying any changes that you have made. This can be messy.

After emerging the packages, we need to tell Entropy what we just did, and add them to Entropy's database. This is done with the command:

# equo rescue spmsync --ask

Finally, to prevent Entropy from downgrading our added packages, we need to edit:

# nano -w /etc/entropy/client.conf

Scroll down, until you find: # ignore-spm-downgrades =

Uncomment that line by removing the # , and change it to:

ignore-spm-downgrades = enable

Now, PLEASE remember, that next time you upgrade the system, Entropy wants to revert the changes made in "client.conf",

by asking you to execute: equo conf update, and overwrite the file. Of course we DON'T want that, so select here to keep the old config file.

Following these rules can make mixing and matching between Entropy and Portage safer, not safe, just safer. With these rules you will have not only a history of what you have done, but a pretty good idea of what needs to get undone if your system becomes unstable or unusable. What you have changed is documented in one or the other of those two configuration files.

Truly it is recommended that you make package requests either in the forums or at Make sure to include version numbers and any specific USE flags that you think are needed/unneeded. This may not get you your package right away, but it will get you and others the package.

Using a Portage Overlay

Sometimes an app is missing from entropy and the portage tree but is in an overlay. In this scenario it's helpful to install what you can through entropy and only install the missing components from portage/overlay.

# equo install layman

To see the list of overlays available, run:

# layman -L

To add an overlay:

# layman -a <overlay-name>

To install an overlay package, it's recommended that you first attempt to install any dependencies you can through entropy:

# emerge --pretend <category>/<package>

Take the list of dependencies and attempt to install them via equo:

# equo install <dependency1> <dependency2> ... <dependencyN>

Finally, let portage install the package and any remaining dependencies that entropy didn't have:

# emerge -av <category>/<package>

Final Note

A final note, if you well and truly have broken your system, there is a step that you might consider before re installing. Remove all the changes to package.mask and package.use then issue the command : equo update && equo world --replay. This will reinstall, to the current level in the online database, every single package on your system that Entropy has a match for ... every package. So it is time consuming and bandwidth intensive.


With all that said, please consider carefully why and what you are doing before mixing the two package managers. In the support channel in IRC we can tolerate ignorance and usually will help to cure the problem, but as grandpa said "There ain't no cure for stupid" and you may be treated accordingly.

Good Luck ~Az


Rebuild Python with tk support

First update portage and overlays, make sure you have "sabayon" in your overlays:

# equo update && equo install eix
# layman -l
* sabayon                   [Git       ] (git://           )
# layman -S && eix-sync

Search for python with eix:

# eix -C dev-lang python
[U] dev-lang/python
     Available versions:  
        (2.4)   2.4.6
        (2.5)   2.5.4-r4
        (2.6)   2.6.4-r1 (~)2.6.4-r1[1] 2.6.5-r2 2.6.5-r3 (~)2.6.6-r1
        (2.7)   [M](~)2.7
        (3.1)   [m]3.1.2-r3 [m]3.1.2-r4
        {-berkdb bootstrap build +cxx doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml}                
     Installed versions:  2.6.5-r2(2.6)(16:21:53 04.05.2010)(berkdb gdbm ipv6 ncurses readline sqlite ssl threads wide-unicode xml -build -doc -elibc_uclibc -examples -tk -wininst)                                                            
     Description:         Python is an interpreted, interactive, object-oriented programming language.

[1] "sabayon" /var/lib/layman/sabayon

Look at "Installed versions", here is "2.6.5-r2". Maybe you have more than one version installed, thats no problem.

Edit "/etc/portage/package.use", add "tk" to "dev-lang/python sqlite" -> "dev-lang/python sqlite tk". Maybe set a marker on top of the file: "# 22. okt 2010 add tk to python" or similar.

Now emerge the pythonversion and check if tk is added:

# emerge -av =python-2.6.5-r2
Calculating dependencies... done!
[ebuild   R   ] dev-lang/python-2.6.5-r2  USE="berkdb gdbm ipv6 ncurses readline sqlite ssl threads tk* (wide-unicode) xml -build -doc -examples -wininst" 10,903 kB

Edit "/etc/entropy/packages/package.mask", add "=dev-lang/python-2.6.5-r2" at the end. Maybe set a marker.

Let "entropy" know about the new python version:

# equo rescue spmsync --ask


Additional info :