After having not done any updates for about a year and a half, my PC was for from up-to-date and even further from up-to-date-able. My portage tree was nothing less than a mess, using overlays that weren't updated in ages. With in the end not being able to print on my brand-new printer, being the final problem to get me to fix it.

Step one, acknowledge you have a problem:

$ emerge --sync && emerge world -uDNav

This resulted in about a 20 odd conflicts.

Step two, cut out the bad parts, removing all overlays, removing all accept_keywords, masks and unmasks.

(Step two b, cut out the rest, removing all use flags).

Now at this point, everything is still broken, but doing a emerge world -uDNpv at every step will show you how far off you still are.

Step three, back to the basics, fixing system:

$ emerge system -uav

Even this didn't work, with libpng ruining my day. So what had happened was that libpng got a new slot, most things depended on slot ":0" which was sortof ok, but not for everything, a slot ":1.5" was added, but not everything was fixed with this. The fix was:

$ emerge -1av media-libs/libpng:{0,1.5}

This emerged libpng-1.5 and libpng-1.6, with 1.5 getting it's own slot. This fixed my system, huzzah! So this was the first real progress. Now for the next step to fixing system:

$ emerge system -uDNav

This messed up because of perl. Perl is something you do not want to break, it's utterly essential to any linux distribution. This was primarilly caused by packages relying on some perl modules, I didn't mind breaking some eggs to recreate my beloved Gentoo installation, so I unmerged all perl modules that caused any problems. This allowed me to upgrade my perl and fix my system tree.

Getting to this point was the hard part, it took me a lot of time to get to a working strategy and finding the information to resolve this. It also made me appreciate the slot system in portage.

Step four:

$ emerge world -uDNav

This caused a lot of problems mostly in the form of blocks. I'm a KDE user (KDE, which has been awesome again since about 4.3), so I didn't need Gnome. Getting rid of Gnome was a hassle, but removing Gnome solved a lot of my problems. Also, it made my wonder why Gnome did this kitchen-sink strategy which was more intrusive that KDE, which also attempts to solve all problems. With Gnome out of the way, I decided to first upgrade KDE:

$ emerge kde-meta -uDNav

This went completely painless and took a lot of the other issues away. After this the world didn't block as much as it did at first. Which some major packages causing some problems. Imagemagick and Libreoffice being the primary culprits. These were quickly resolved by upgrading these individually, a painless exercise that resulted in a quick final emerge and took my system into a new clean state.

Most problems I encountered were easily fixed by just doing a merge of some problem packages. The two problems that really stumped me were Perl and libpng. The libpng issue really just made me appreciate the slot system of portage and serves as a good pointer of where to look the next time I have an issue. Having to remove Perl packages to fix something that isn't effectively broken, that's a major disappointment and shows this part of Gentoo is not controlled effectively.