Recently Gentoo refused to upgrade, it said:

[blocks B      ] sys-apps/kmod ("sys-apps/kmod" is blocking sys-apps/module-init-tools-3.16-r1)
[blocks B      ] sys-apps/module-init-tools ("sys-apps/module-init-tools" is blocking sys-apps/kmod-7)

Total: 161 packages (143 upgrades, 1 downgrade, 6 new, 11 reinstalls), Size of downloads: 899,585 kB
Conflict: 32 blocks (2 unsatisfied)

I let it slip this few weeks because I don’t have enough time to resolve it and I thought that Gentoo would someday resolve it. Unfortunately, until this time of writing, it has not resolved. So, I have to figure out what was the problem.

It seems that module-init-tools is being obsoleted by its upstream maintainer in favor of KMOD. According to MikeTBob in Linux Forum and toralf in Gentoo forum, the fix is to remove module-init-tools and to install KMOD:

$ emerge -C module-init-tools && emerge -avU kmod

Still, this doesn’t worked out for me. But a post from ssuominen in the same thread suggested that the problem might from Bug #409017. According to this bug, many current profile is still linked to old profile in

/usr/portage/profiles/default/linux/amd64/10.0

After investigating a bit, I found out that my make.conf was altered with this line:

PORTDIR_OVERLAY=/usr/local/portage

I don’t know who put that there, but after investigating a bit, I found out that “/usr/portage” was last time synced in 6 July 2011. Whoa… kind of old. And all this time I was using “/usr/local/portage”. I’m still investigating why this would happens. But, now I have found my solution. I have to select current profile. The list are:

$ eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/10.0
  [2]   default/linux/amd64/10.0/selinux
  [3]   default/linux/amd64/10.0/desktop
  [4]   default/linux/amd64/10.0/desktop/gnome
  [5]   default/linux/amd64/10.0/desktop/kde
  [6]   default/linux/amd64/10.0/developer
  [7]   default/linux/amd64/10.0/no-multilib
  [8]   default/linux/amd64/10.0/server
  [9]   hardened/linux/amd64
  [10]  hardened/linux/amd64/selinux
  [11]  hardened/linux/amd64/no-multilib
  [12]  hardened/linux/amd64/no-multilib/selinux

Look, nothing is selected. We should select one. Yours may vary. But, I choose KDE Desktop profile:

$ eselect profile set 5

Voila, now I can carry on life.

BONUS: Fix This Mess

I don’t satisfied with “just work” solution. I need to have consistent portage directory. At this point, I would like to have only one legitimate portage directory. These later methods might not be the best method and I am not encouraging you to do the same as I. But, in case you too want to have the consistent portage dir, let’s do this.

First, remove the line

PORT_DIR=/usr/local/portage

from “make.conf”. I think this was added by layman in some point in 6 July 2011, or not…. Anyway, that’s that.

Next, update the portage tree again.

$ eix-sync

I’m using EIX and you should too. But if not, use the traditional one

$ emerge --sync

In my case, it took quite a while for the tree to be synced completed.

If anything goes right, none of the profile is selected, just like the above. Then, reselect the profile:

$ eselect profile set 5

Let’s double check that it lead to “/usr/portage” and not “/usr/local/portage”:

$ ls -al /etc/make.profile
lrwxrwxrwx 1 root root 60 Apr  3 07:48 /etc/make.profile -> ../usr/portage/profiles/default/linux/amd64/10.0/desktop/kde

Yup, it’s there. Now, make a leap of faith:

$ rm -rf /usr/local/portage

Considering that “distfiles” is in “/usr/portage”, I think the “/usr/local/portage” is no longer needed.

Just a bonus, emerge have new parameter “–autounmask-write” to add certain packages USE parameters automatically in “/etc/portage/package.use” in order to upgrade. Add that parameter to write changes needed.

Now, I can really carry on with my life.