Gentoo - Dealing with Blockers

The portage software management system is an extremely powerful program.

Because of the complexity of its job, sometimes it doesn’t work quite how we’d expect.

One particular problem is packages blocking other packages from installing.


Dealing with blockers

Sometimes when upgrading we may hit packages that block other packages from emerging. This example output from ‘emerge system -DNuvp’ shows this:

...
[blocks B     ] sys-libs/ss (is blocking sys-libs/e2fsprogs-libs-1.41.3)
[blocks B     ] <sys-fs/e2fsprogs-1.41 (is blocking sys-libs/e2fsprogs-libs-1.41.3)
[blocks B     ] sys-libs/com_err (is blocking sys-libs/e2fsprogs-libs-1.41.3)
[blocks B     ] sys-libs/e2fsprogs-libs (is blocking sys-libs/ss-1.40.9, sys-libs/com_err-1.40.9)

These lines with ‘blocks B’ near the front are packages that are blocking other packages from being installed.

In this case, three different packages (‘ss’, ‘e2fsprogs-1.41’, and ‘com_err’) are blocking ‘e2fsprogs-libs-1.41.3’. When upgrading, these are usually packages that have been superceded by other packages. Here we can see that the newer package is the ‘e2fsprogs-libs-1.41.3’ so we need to remove the blockers.

‘e2fsprogs-1.41’ is a version specific block, generally we could just upgrade this individually to make things work, but in this case, it’s the newer version that’s trying to pull in ‘e2fsprogs-libs-1.41.3’ so we’ll have to remove all the blockers to continue.

If you’re not sure what a package is, it may help to get some more information on it before removing it. For example these commands will help in finding information about the ‘ss’ package:

equery files ss
man ss
ls /usr/share/doc/ss
grep http /usr/portage/sys-libs/ss/*.ebuild

Now we know it’s just another name for ‘e2fsprogs’; this must be just a renaming or absorbing of multiple packages into one. Time to remove the old one:

sudo emerge --unmerge ss

Lets see if that was enough to allow us to continue our upgrade (or emerge):

demo@demo ~ $ sudo emerge system -DNuvp
...
[blocks B     ] <sys-fs/e2fsprogs-1.41 (is blocking sys-libs/e2fsprogs-libs-1.41.3)
[blocks B     ] sys-libs/com_err (is blocking sys-libs/e2fsprogs-libs-1.41.3)
[blocks B     ] sys-libs/e2fsprogs-libs (is blocking sys-libs/com_err-1.40.9)

OK we still need to remove ‘com_err’, so we repeat the above sequence for that. We check if we can do without it, and if we can, ‘–unmerge’ it. Then check the block list again.

All that’s left to remove now is:

[blocks B     ] <sys-fs/e2fsprogs-1.41 (is blocking sys-libs/e2fsprogs-libs-1.41.3)

In this case it is a bit of a risk to remove ‘e2fsprogs’ because it’s an important system library, have a look:

demo@demo ~ $ sudo emerge --unmerge e2fsprogs -vp
...
!!! 'sys-fs/e2fsprogs' is part of your system profile.
!!! Unmerging it may be damaging to your system.

After much searching I found there’s no other way around it. So we would remove ‘e2fsprogs’, then run the system upgrade one more time with ‘-vp’, then finally do the real thing:

sudo emerge system -DNu

In this real world example, the newer version of e2fsprogs installed, and the upgrade went through without a hitch.

Other Blocking Cases

Sometimes it’s only a certain version of a package that is causing trouble and the situation is much simpler than above. In this case you can usually just upgrade or downgrade that blocker on its own by re-emerging it before emerging the whole group.

Sometimes you’ll find that the package being blocked is not what you want installed anyway. In that case you can usually just ‘–unmerge’ that package to remove it from the ‘system’ and ‘world’ sets so it won’t be pulled in.

Useful Tools

Sometimes the blocker may be pulled in by other packages. To see if something is being pulled in by other packages you can use the ‘–depclean’ emerge flag. For example:

sudo emerge --depclean gcc -vp

Calculating dependencies... done!
  sys-devel/gcc-4.1.2 pulled in by:
    sys-libs/glibc-2.6.1
    system

>>> No packages selected for removal by depclean
Packages installed:   117
Packages in world:    7
Packages in system:   51
Required packages:    117
Number removed:       0

Other Sources of Help

If you do get really stuck with portage, try typing the offending package name or error message in to the search at the the gentoo bugs database, use the ‘advanced search’ and look for ‘all bugs’.

You can also try the gentoo IRC channel. There will usually be someone else who’s hit the problem and has a solution.

matiu

Want to comment?


(not made public)

(optional)

(use plain text or Markdown syntax)