December 6, 2011

Another 5-month update

I have one system that I rarely update (it's not the best idea, but it allows me to write a blog post from time to time), so I wanted to show you again that it's possible to update without re-installing, and that everything is solvable and logical unless you have a very complicated setup.

The commands might seem more complicated than "apt-get dist-upgrade", but remember Gentoo gives you much greater flexibility (USE flags, kernel versions, backporting, etc, etc).

Let me just post a few commented output "dumps":

Timestamp of tree: Tue, 21 Jun 2011 20:45:01 +0000

# emerge -uDNa world

Usually portage updates itself as the first package. This time it was different due to a block (auto-resolved), but to be even safer I decided to start with updating portage explicitly.


# emerge -1av portage

[ebuild     U ] sys-apps/portage-2.1.10.11 [2.1.9.42] USE="(ipc) less -build -doc -epydoc -python2 -python3 (-selinux)" LINGUAS="pl" 830 kB                                                                   
*** Portage will stop merging at this point and reload itself,
    then resume the merge.
[blocks B     ] <app-admin/logrotate-3.8.0 ("<app-admin/logrotate-3.8.0" is blocking sys-apps/portage-2.1.10.11)                                                                                              

Total: 1 package (1 upgrade), Size of downloads: 830 kB
Conflict: 1 block (1 unsatisfied)

# emerge -1av portage logrotate

[ebuild     U ] app-admin/logrotate-3.8.0 [3.7.9-r1] USE="acl%* (-selinux)" 48 kB
[ebuild     U ] sys-apps/portage-2.1.10.11 [2.1.9.42] USE="(ipc) less -build -doc -epydoc -python2 -python3 (-selinux)" LINGUAS="pl" 830 kB  

As you see the blocker was trivial, just had to update logrotate first.

# dispatch-conf

Remember to run dispatch-conf as soon as portage tells you to do so.

# emerge -uDNa world

make[1]: Entering directory `/var/tmp/portage/media-gfx/sane-backends-1.0.22-r1/work/sane-backends-1.0.22/po'
generating bg.mo from bg.po
generating cs.mo from cs.po
/usr/bin/msgfmt: error while loading shared libraries: libicui18n.so.46: cannot open shared object file: No such file or directory
/usr/bin/msgfmt: error while loading shared libraries: libicui18n.so.46: cannot open shared object file: No such file or directory
make[1]: *** [bg.mo] Error 127
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [cs.mo] Error 127
make[1]: Leaving directory `/var/tmp/portage/media-gfx/sane-backends-1.0.22-r1/work/sane-backends-1.0.22/po'
make: *** [all-recursive] Error 1
 * ERROR: media-gfx/sane-backends-1.0.22-r1 failed (compile phase):
 *   emake failed

This is where people frequently get frustrated. However, you can easily recognize the "error while loading shared libraries" pattern and run revdep-rebuild. A better solution (a.k.a preserved-libs) is in development.

# revdep-rebuild

This updated a few packages, so I ran it once more just to be sure (it didn't rebuild anything).

# revdep-rebuild
# emerge -uDNa world
# dispatch-conf
# revdep-rebuild
# dispatch-conf

It's a good idea to rebuild X11 drivers after updating X, this is yet another "standard" thing that can frustrate people who don't know about it.

# emerge -1av $(eix --only-names -I xf86- -C x11-drivers)

Then a standard kernel update.

# eselect kernel list
# eselect kernel set 7
# cd /usr/src/linux
# zcat /proc/config.gz > .config
# make oldconfig
# make -j3 && make modules_install install
# module-rebuild rebuild

Then a GCC update. Note updated GCC update guide, especially no need to rebuild entire world! Just libtool.

# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.4.5 *
 [2] x86_64-pc-linux-gnu-4.5.3
# gcc-config 2
# env-update && source /etc/profile
# emerge --oneshot libtool
# revdep-rebuild --library '/usr/lib64/libltdl.so.3'
# rm '/usr/lib64/libltdl.so.3'

Finally, a cleanup:

# emerge --depclean --ask
# revdep-rebuild

Finally, a few tips for DVD playback (Dragon Player decided to stop working):

# emerge -av smplayer

Then there was some glitch with udev rules resulting in /dev/dvd symlink not being present. Probably because of some udev or kernel update, because I don't remember changing hardware in that box. Anyway, it's quite simple to regenerate and later adjust the rules.

# rm /etc/udev/rules.d/70-persistent-cd.rules
# /etc/init.d/udev restart

You may need to manually edit /etc/udev/rules.d/70-persistent-cd.rules and replace dvd1 with dvd:

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:06.0-scsi-1:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"

And that was it! Hopefully this little report will help someone updating a Gentoo system.