Gentoo: Making Sense of Portage

Updating the System

After I have installed Gentoo, I like to fully update the system – if nothing else, just to check everything works as expected. To do this I follow the official documentation for updating Gentoo (and you should too). Below I essentially just summarise the process.

emerge --sync
emerge --ask --update world
emerge --ask --update --deep world
emerge --ask --update --deep --with-bdeps=y world

I have not updated my USE flags recently so do not run.

emerge --ask --update --deep --with-bdeps=y --newuse world

Hopefully everything went without a hitch. You should also run the following commands.

emerge --ask --depclean
revdep-rebuild

You will need to make sure gentoolkit is installed for revdep-rebuild to work.

Install gentoolkit

emerge --ask gentoolkit

[collapse]

General Usage Tips

Some general usage tips that might help a newbie to Gentoo.

News from Emerge

From time-to-time when you run emerge --sync to update the ebuild repository, you will notice the following message at the end of the output.

...
sent 224.19K bytes  received 16.71M bytes  787.62K bytes/sec
total size is 302.18M  speedup is 17.84

Performing Global Updates:
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
  p='update /etc/portage/package.*'
/usr/portage/profiles/updates/3Q-2013.........



 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

storm ~ #

Don’t just ingore these! It is a good idea to read them and be aware of any system changes.

To read any new message in a friendly format (mbox), run the following command.

eselect news read new --mbox

You might need to pipe the output to less if you have multiple new messages and don’t have the ability to scroll up.

eselect news read new --mbox | less

In this instance, it’s not an issue that concerns me.

Spoiler

storm ~ # eselect news read new --mbox
2013-08-23-emerge-language
  Title                     Language of messages in emerge logs and output
  Author                    Andreas K. Huettel 
  Posted                    2013-08-23
  Revision                  1

As of today, messages and logs of emerge do not use the system 
locale anymore but default to English. The intention behind this
is to ease the work of bug wranglers and package maintainers, 
who may have a hard time reading build logs in foreign 
languages. This change only affects the language of messages 
in emerge output, nothing else.

If you really want to have e.g. localized compiler error messages
in your builds, set LC_MESSAGES in your /etc/portage/make.conf.
Note that submitting localized build logs to the Gentoo Bugzilla
is discouraged. If maintainers are unable to translate the 
necessary information from the build log, your bug may be closed
as NEEDINFO and you may be asked to re-open it submitting an 
English build log [1] before any further action can be taken.

For more details with respect to localization, see
https://wiki.gentoo.org/wiki/Localization/HOWTO

[1] LC_MESSAGES=C emerge ...

storm ~ # 

[collapse]

Protect the Kernel Sources from Being Removed

If a new kernel source package becomes available, you are free to download and compile when you get around to it. However, when you next run “emerge --ask --depclean“, emerge will try to remove the old sources. Which I don’t want because this is the kernel I am currently using.

To protect you kernel sources, run the below command replacing the kernel version for the one you want to keep.

emerge --noreplace sys-kernel/gentoo-sources:3.8.13

And then re-run.

emerge --ask --depclean

Updating Portage

Occasionally when updating your eBuilds with emerge --sync, you need to update portage itself.


Spoiler

...
File list transfer time: 0.000 seconds
Total bytes sent: 737.79K
Total bytes received: 39.81M

sent 737.79K bytes received 39.81M bytes 772.30K bytes/sec
total size is 303.77M speedup is 7.49

Performing Global Updates:
(Could take a couple of minutes if you have a lot of binary packages.)
.='update pass' *='binary update' #='/var/db update' @='/var/db move'
s='/var/db SLOT move' %='binary move' S='binary SLOT move'
p='update /etc/portage/package.*'
/usr/portage/profiles/updates/3Q-2013...........

* An update to portage is available. It is _highly_ recommended
* that you update portage now, before any other packages are updated.

* To update portage, run 'emerge --oneshot portage' now.

storm ~ #

[collapse]

In such a case, update portage now before updating anything else.

emerge --oneshot portage

What to do when Configuration Files Need Updating

When updating software, sometimes the configuration file also needs to be updated. As such, you will occassionally see messages similar to the below.

 * IMPORTANT: 2 config files in '/etc' need updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.

In such a case, use the find._cfg????_* search as a parameter to the -name argument.

storm ~ # find /etc/ -name '._cfg????_*'
/etc/portage/._cfg0000_make.conf
/etc/portage/repos.conf/._cfg0000_gentoo.conf
storm ~ # 

Here we see two configuration files have been updated. First lets take a look at the portage make file. We do this by comparing (diff) the two files. The -y argument shows the differences side-by-side.

diff -y  /etc/portage/make.conf /etc/portage/._cfg0000_make.conf

This clearly shows that the update is quite important as it probably fixes some compatibility issues.


Spoiler

storm ~ # diff -y /etc/portage/make.conf /etc/portage/._cfg0000_make.conf
# Originally these settings were set by the catalyst build sc # Originally these settings were set by the catalyst build sc
# built the stage used by the Live DVD. # built the stage used by the Live DVD.
# #
# Please consult /usr/share/portage/config/make.conf.example # Please consult /usr/share/portage/config/make.conf.example
# detailed example. # detailed example.

# Defines the optimisation flags for gcc's C and C++ compiler # Defines the optimisation flags for gcc's C and C++ compiler
CFLAGS="-O2 -pipe -march=native" CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}"

# WARNING: Changing your CHOST is not something that should b # WARNING: Changing your CHOST is not something that should b
# Please consult http://www.gentoo.org/doc/en/change-chost.xm # Please consult http://www.gentoo.org/doc/en/change-chost.xm
CHOST="x86_64-pc-linux-gnu" CHOST="x86_64-pc-linux-gnu"

# MAKEOPTS defines how many parallel compilations should be d # MAKEOPTS defines how many parallel compilations should be d
# a package. Normally the number of CPU cores plus 1. For t # a package. Normally the number of CPU cores plus 1. For t
# I have an i7 (with 8 core I beleive). # I have an i7 (with 8 core I beleive).
MAKEOPTS="-j9" MAKEOPTS="-j9"

# These are the USE flags that were used in addition to what # These are the USE flags that were used in addition to what
# profile used for building. # profile used for building.
#USE="bindist mmx sse sse2" #USE="bindist mmx sse sse2"
USE="bindist mmx sse sse2 X qt4 alsa cdr a52 aac aalib ao aud USE="bindist mmx sse sse2 X qt4 alsa cdr a52 aac aalib ao aud

# Select local mirrors for faster downloading of updates and # Select local mirrors for faster downloading of updates and
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ http://mi GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ http://mi
# Qube Managment. # Qube Managment.
SYNC="rsync://rsync1.uk.gentoo.org/gentoo-portage" SYNC="rsync://rsync1.uk.gentoo.org/gentoo-portage"
# Any available mirror. # Any available mirror.
#SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage" #SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"

# Used by system to set the video drivers. # Used by system to set the video drivers.
VIDEO_CARDS="nouveau" VIDEO_CARDS="nouveau"

# Used to determine which drivers are to be built for input d # Used to determine which drivers are to be built for input d
INPUT_DEVICES="evdev" INPUT_DEVICES="evdev"
>
> # Set PORTDIR for backward compatibility with various tools:
> # gentoo-bashcomp - bug #478444
> # euse - bug #474574
> # euses and ufed - bug #478318
> PORTDIR="/usr/portage"
storm ~ #

[collapse]

To update the new configuration file, we run the following command.

mv -v /etc/portage/._cfg0000_make.conf /etc/portage/make.conf

Now the other file, /etc/portage/repos.conf/._cfg0000_gentoo.conf, appears to be a new file as the is no ‘gentoo.conf‘ to compare with. After some research, it would seem the SYNC variable is being deprecated.

storm ~ # mv -v /etc/portage/repos.conf/._cfg0000_gentoo.conf /etc/portage/repos.conf/gentoo.conf
'/etc/portage/repos.conf/._cfg0000_gentoo.conf' -> '/etc/portage/repos.conf/gentoo.conf'
storm ~ #

Now might be a good time to reboot and check everything still works.

Updating Grub2

When one of the packages been updated is Grub2, it is important to do the following then reboot to check everything still works. Don’t forget to mount boot first if needed.

grub2-mkconfig -o /boot/grub/grub.cfg
grub2-install /dev/sda
grub2-install /dev/sdb

Make sure you adjust the above commands to match your environment. For example, you will probably only need to run grub2-install once on the disk with the bootloader on it. For more information about my setup, see here (actual link and article coming soon – sorry).

Issues

Some issues I have run into and how I (hopefully) got around them.

Circular Dependencies Suck!

From time to time you might be hit by a circular dependency error when trying to install some piece of software. In this instance I was trying to install imagemagick.

Circular dependencies aren’t as scarry as they sound. It just means that program A depends on program B but program B depends on program A. It’s a sort of “chicken or the egg” senareo you sometimes come across when compiling software. Fortunately, the output expains exactly what to do!

Total: 39 packages (39 new), Size of downloads: 147,446 kB

 * Error: circular dependencies:

(dev-libs/DirectFB-1.4.9-r1::gentoo, ebuild scheduled for merge) depends on
 (media-libs/libsdl-1.2.15-r2::gentoo, ebuild scheduled for merge) (buildtime)
  (dev-libs/DirectFB-1.4.9-r1::gentoo, ebuild scheduled for merge) (buildtime)

It might be possible to break this cycle
by applying any of the following changes:
- media-libs/libsdl-1.2.15-r2 (Change USE: -directfb)
- dev-libs/DirectFB-1.4.9-r1 (Change USE: -sdl)

Note that this change can be reverted, once the package has been installed.

Note that the dependency graph contains a lot of cycles.
Several changes might be required to resolve all cycles.
Temporarily changing some use flag for all packages might be the better option.

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

sys-auth/pambase:0

  (sys-auth/pambase-20120417-r2::gentoo, installed) pulled in by
    (no parents that aren't satisfied by other packages in this slot)

  (sys-auth/pambase-20120417-r2::gentoo, ebuild scheduled for merge) pulled in by
    sys-auth/pambase[consolekit] required by (sys-auth/polkit-0.110::gentoo, ebuild scheduled for merge)


!!! Enabling --newuse and --update might solve this conflict.
!!! If not, it might help emerge to give a more specific suggestion.

storm ~ #

Here DirectFB depends on libsdl, but libsdl depends on DirectFB. To break the circular dependency, you should be able to run either…

echo "dev-libs/DirectFB -sdl" >> /etc/portage/package.use

…or.

echo "media-libs/libsdl -directfb" >> /etc/portage/package.use

Then try to install your program again. In my case.

emerge --ask imagemagick

That did the trick for me! Once installed, you can remove (or comment out) the entry you just made.

Issue installing gparted

Output

make[2]: Leaving directory `/var/tmp/portage/sys-block/gparted-0.14.1/work/gparted-0.14.1'
make[1]: Leaving directory `/var/tmp/portage/sys-block/gparted-0.14.1/work/gparted-0.14.1'
>>> Completed installing gparted-0.14.1 into /var/tmp/portage/sys-block/gparted-0.14.1/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/sbin/gpartedbin
ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/doc

>>> Installing (10 of 10) sys-block/gparted-0.14.1
 * Updating desktop mime database ...
 * Updating shared mime info database ...
 * Updating icons cache ...                                                                                                                          [ ok ]
 * Updating scrollkeeper database ... ...                                                                                                            [ ok ]

>>> Recording sys-block/gparted in "world" favorites file...

 * Messages for package sys-fs/fuse-2.9.2:

 *   CONFIG_FUSE_FS:	 is not set when it should be.
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.

 * Messages for package sys-fs/ntfs3g-2012.1.15-r2:

 *   CONFIG_FUSE_FS:	 is not set when it should be.
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
storm ~ # 

As the message indicates, including CONFIG_FUSE_FS in the Kernel configuration should fix it. Check with.

andy@storm ~ $ grep -i config_fuse /usr/src/linux/.config
CONFIG_FUSE_FS=y

Enable the following using make menuconfig.

File systems --->
  ...
  <*> FUSE (Filesystem in Userspace) support
  ...

Adobe Flash Masked

If you see a message like this.

!!! The following updates are masked by LICENSE changes:
- www-plugins/adobe-flash-11.2.202.310::gentoo (masked by: AdobeFlash-11.x license(s))
A copy of the 'AdobeFlash-11.x' license is located at '/usr/portage/licenses/AdobeFlash-11.x'.

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

It means that package, AdobeFlash, can not update as it has been masked. Taking a look at /etc/portage/package.license

=www-plugins/adobe-flash-11.2.202.297 AdobeFlash-11.x

…I could see this was wrong. Changing it to the below seemed to work.

>=www-plugins/adobe-flash-11.2.202.310 AdobeFlash-11.x

Don’t forget to backup before making changes!

cp -v /etc/portage/package.license /etc/portage/package.license.backup
nano /etc/portage/package.license

Shit the bed – I can’t boot!!!

Today I updated my Gentoo system, pulled in as part of that was an update to Grub2. I’m not sure what the update was from but it was to, version 2.00_p5107-r1. Fair enough I thought and continued.

After running the usual post-grub2 updates commands and rebooting…

mount /boot
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
grub2-install /dev/sdb
reboot

I was hit by this horrible looking screen!

                      GNU GRUB version 2.00

     Minimal BASH-like line editing is supported. For the first word, TAB
     lists possible command completions. Anywhere else TAB lists possible
     device or file completions.

grub> _

Now I’m not sure yet exactly what broke Gentoo/Grub2 but fortunately it doesn’t look too serious as I was able to boot from the grub console.

Running ls shows what Grub2 can see. My output looks like the below.

grub> ls
(lvm/vgssd-lvroot) (lvm/vgssd-lvboot) (lvm/vgsata-lvusrportage) (lvm/vgsata-lvlar) (lvm/vgsata-lvvhdd) (lvm/vgsata-lvhome) (md/1) (md/2) (md/0) (hd0) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt2) (hd1,gpt1) (hd2) (hd2,gpt2) (hd2,gpt1) (hd3) (hd3,gpt2) (hd3,gpt1)
set root=(lvm/vgssd-lvroot)
linux (lvm/vgssd-lvboot)/kernel-x86_64-3.8.13-gentoo root=/dev/vgssd/lvroot domdadm dolvm
initrd (lvm/vgssd-lvboot)/initramfs-genkernel-x86_64-3.8.13-gentoo
boot

Turned out that the updated version of Grub2 now uses the /boot/grub/ location as its default directory instead of /boot/grub2/.

Once you’ve managed to get back into your system, just change the name of the grub2 directory and re-run you’re post-grub install commands.

mv -v /boot/grub2 /boot/grub
grub2-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
grub-install /dev/sdb

Panic over!

BIG fail from XMonad

My latest panic again begins with the usual suspect.

emerge --ask --update --deep world

All seemed to be going quite nicely until….shazam – I was hit with this horrendous-looking message.

...
xmonad-0.11: dependency "mtl-2.1.2-13f4208352cc5325345c647d781767bd" doesn't exist (ignoring)
xmonad-0.11: dependency "process-1.1.0.2-a586d11dc7851f4667ecc08a77cbde3a" doesn't exist (ignoring)
xmonad-0.11: dependency "unix-2.6.0.1-cfa0dfa0c0e4ad0679f8e7c8dbf4a9bb" doesn't exist (ignoring)
xmonad-0.11: dependency "utf8-string-0.3.7-1d0990243cdcebf03df4fdedfb179fd3" doesn't exist (ignoring)
xmonad-0.11: import-dirs: /usr/lib64/xmonad-0.11/ghc-7.6.3 doesn't exist or isn't a directory (ignoring)
xmonad-0.11: file XMonad.hi is missing (ignoring)
xmonad-0.11: file XMonad/Main.hi is missing (ignoring)
xmonad-0.11: file XMonad/Core.hi is missing (ignoring)
xmonad-0.11: file XMonad/Config.hi is missing (ignoring)
xmonad-0.11: file XMonad/Layout.hi is missing (ignoring)
xmonad-0.11: file XMonad/ManageHook.hi is missing (ignoring)
xmonad-0.11: file XMonad/Operations.hi is missing (ignoring)
xmonad-0.11: file XMonad/StackSet.hi is missing (ignoring)
xmonad-0.11: cannot find libHSxmonad-0.11.a on library path (ignoring)
Writing new package config file... done.
>>> Completed installing xmonad-0.11-r1 into /var/tmp/portage/x11-wm/xmonad-0.11-r1/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/lib64/xmonad-0.11/ghc-7.6.3/libHSxmonad-0.11.a
   usr/lib64/xmonad-0.11/ghc-7.6.3/HSxmonad-0.11.o
   usr/bin/xmonad
ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/doc

>>> Installing (25 of 32) x11-wm/xmonad-0.11-r1
 * Package xmonad-0.11 is not installed for ghc-7.6.3.
 * Registering xmonad-0.11  ...
xmonad-0.11: Warning: haddock-interfaces: /usr/share/doc/xmonad-0.11-r1/html/xmonad.haddock doesn't exist or isn't a file                                                                                                                                                                                            [ ok ]
 * A sample xmonad.hs configuration file can be found here:
 *     /usr/share/xmonad-0.11-r1/ghc-7.6.3/man/xmonad.hs
 * The parameters in this file are the defaults used by xmonad.
 * To customize xmonad, copy this file to:
 *     ~/.xmonad/xmonad.hs
 * After editing, use 'mod-q' to dynamically restart xmonad 
 * (where the 'mod' key defaults to 'Alt').
 * 
 * Read the README or man page for more information, and to see 
 * other possible configurations go to:
 *     http://haskell.org/haskellwiki/Xmonad/Config_archive
 * Please note that many of these configurations will require the 
 * x11-wm/xmonad-contrib package to be installed.

>>> Emerging (26 of 32) x11-wm/xmonad-contrib-0.11.2
 * xmonad-contrib-0.11.2.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                                                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking xmonad-contrib-0.11.2.tar.gz to /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work
>>> Source unpacked in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work
>>> Preparing source in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2 ...
 * Using cabal-1.16.0.3.
 * Prepending /usr/lib64/ghc-7.6.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-1.16.0.3 --make /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.lhs -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.lhs, /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=xmonad-contrib-0.11.2/ghc-7.6.3 --datadir=/usr/share/ --datasubdir=xmonad-contrib-0.11.2/ghc-7.6.3 --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/xmonad-contrib-0.11.2 --verbose --flags=-testing --flags=use_xft
Configuring xmonad-contrib-0.11.2...
setup: At least the following dependencies are missing:
X11-xft >=0.2
 * Detected outdated packages: dev-haskell/x11-xft:0 app-admin/haskell-updater:0 x11-wm/xmonad-contrib:0
 * ERROR: x11-wm/xmonad-contrib-0.11.2::gentoo failed (configure phase):
 *   //==-- Please, run 'haskell-updater' to fix outdated packages --==//
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2847:  Called haskell-cabal_src_configure '--flags=-testing' '--flags=use_xft'
 *   environment, line 2158:  Called cabal-configure '--flags=-testing' '--flags=use_xft'
 *   environment, line  490:  Called cabal-show-brokens-and-die 'setup configure failed'
 *   environment, line  561:  Called cabal-show-old
 *   environment, line  566:  Called cabal-die-if-nonempty 'outdated' 'dev-haskell/x11-xft:0' 'app-admin/haskell-updater:0' 'x11-wm/xmonad-contrib:0'
 *   environment, line  506:  Called die
 * The specific snippet of code:
 *       die "//==-- Please, run 'haskell-updater' to fix ${breakage_type} packages --==//"
 * 
 * If you need support, post the output of `emerge --info '=x11-wm/xmonad-contrib-0.11.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/xmonad-contrib-0.11.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'
 * S: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'

>>> Failed to emerge x11-wm/xmonad-contrib-0.11.2, Log file:

>>>  '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'

 * Messages for package dev-lang/ghc-7.6.3-r1:

 * Limiting MAKEOPTS -j9 -> -j4 (bug #456386)
 * 
 * ************************************************************************
 * 
 * You have just upgraded from an older version of GHC.
 * You may have to run
 *       'haskell-updater --upgrade'
 * to rebuild all ghc-based Haskell libraries.
 * 
 * ************************************************************************
 * 

 * Messages for package x11-wm/xmonad-0.11-r1:

 * A sample xmonad.hs configuration file can be found here:
 *     /usr/share/xmonad-0.11-r1/ghc-7.6.3/man/xmonad.hs
 * The parameters in this file are the defaults used by xmonad.
 * To customize xmonad, copy this file to:
 *     ~/.xmonad/xmonad.hs
 * After editing, use 'mod-q' to dynamically restart xmonad 
 * (where the 'mod' key defaults to 'Alt').
 * 
 * Read the README or man page for more information, and to see 
 * other possible configurations go to:
 *     http://haskell.org/haskellwiki/Xmonad/Config_archive
 * Please note that many of these configurations will require the 
 * x11-wm/xmonad-contrib package to be installed.

 * Messages for package x11-wm/xmonad-contrib-0.11.2:

 * Detected outdated packages: dev-haskell/x11-xft:0 app-admin/haskell-updater:0 x11-wm/xmonad-contrib:0
 * ERROR: x11-wm/xmonad-contrib-0.11.2::gentoo failed (configure phase):
 *   //==-- Please, run 'haskell-updater' to fix outdated packages --==//
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2847:  Called haskell-cabal_src_configure '--flags=-testing' '--flags=use_xft'
 *   environment, line 2158:  Called cabal-configure '--flags=-testing' '--flags=use_xft'
 *   environment, line  490:  Called cabal-show-brokens-and-die 'setup configure failed'
 *   environment, line  561:  Called cabal-show-old
 *   environment, line  566:  Called cabal-die-if-nonempty 'outdated' 'dev-haskell/x11-xft:0' 'app-admin/haskell-updater:0' 'x11-wm/xmonad-contrib:0'
 *   environment, line  506:  Called die
 * The specific snippet of code:
 *       die "//==-- Please, run 'haskell-updater' to fix ${breakage_type} packages --==//"
 * 
 * If you need support, post the output of `emerge --info '=x11-wm/xmonad-contrib-0.11.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/xmonad-contrib-0.11.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'
 * S: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'

 * Regenerating GNU info directory index...
 * Processed 124 info files.
 * After world updates, it is important to remove obsolete packages with
 * emerge --depclean. Refer to `man emerge` for more information.

Ugly!

Ran:

storm ~ # emerge --ask --update --deep --with-bdeps=y world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] dev-util/boost-build-1.52.0-r1 [1.49.0] USE="{-test%}" 
[ebuild     U  ] dev-libs/boost-1.52.0-r6 [1.49.0-r2] USE="nls%* threads%*" PYTHON_TARGETS="python2_7%* python3_2%* -python2_6% (-python3_3)" 
[ebuild  rR    ] x11-wm/xmonad-contrib-0.11.2 
[ebuild     U  ] sys-boot/syslinux-4.07 [4.06]
[ebuild     U  ] net-wireless/bluez-4.101-r6 [4.101-r5]
[ebuild  r  U  ] app-text/poppler-0.22.5 [0.22.2-r2]
[ebuild  rR    ] net-print/cups-filters-1.0.34-r1 
[ebuild     U  ] sys-auth/polkit-0.112 [0.110]
[ebuild     U  ] media-libs/libsdl-1.2.15-r4 [1.2.15-r2]

Would you like to merge these packages? [Yes/No] 

But failed:

>>> Emerging (3 of 9) x11-wm/xmonad-contrib-0.11.2
 * xmonad-contrib-0.11.2.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                                                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking xmonad-contrib-0.11.2.tar.gz to /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work
>>> Source unpacked in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work
>>> Preparing source in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2 ...
 * Using cabal-1.16.0.3.
 * Prepending /usr/lib64/ghc-7.6.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-1.16.0.3 --make /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.lhs -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.lhs, /var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=xmonad-contrib-0.11.2/ghc-7.6.3 --datadir=/usr/share/ --datasubdir=xmonad-contrib-0.11.2/ghc-7.6.3 --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/xmonad-contrib-0.11.2 --verbose --flags=-testing --flags=use_xft
Configuring xmonad-contrib-0.11.2...
setup: At least the following dependencies are missing:
X11-xft >=0.2
 * Detected outdated packages: dev-haskell/x11-xft:0 app-admin/haskell-updater:0 x11-wm/xmonad-contrib:0
 * ERROR: x11-wm/xmonad-contrib-0.11.2::gentoo failed (configure phase):
 *   //==-- Please, run 'haskell-updater' to fix outdated packages --==//
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2847:  Called haskell-cabal_src_configure '--flags=-testing' '--flags=use_xft'
 *   environment, line 2158:  Called cabal-configure '--flags=-testing' '--flags=use_xft'
 *   environment, line  490:  Called cabal-show-brokens-and-die 'setup configure failed'
 *   environment, line  561:  Called cabal-show-old
 *   environment, line  566:  Called cabal-die-if-nonempty 'outdated' 'dev-haskell/x11-xft:0' 'app-admin/haskell-updater:0' 'x11-wm/xmonad-contrib:0'
 *   environment, line  506:  Called die
 * The specific snippet of code:
 *       die "//==-- Please, run 'haskell-updater' to fix ${breakage_type} packages --==//"
 * 
 * If you need support, post the output of `emerge --info '=x11-wm/xmonad-contrib-0.11.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/xmonad-contrib-0.11.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'
 * S: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'

>>> Failed to emerge x11-wm/xmonad-contrib-0.11.2, Log file:

>>>  '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'

 * Messages for package x11-wm/xmonad-contrib-0.11.2:

 * Detected outdated packages: dev-haskell/x11-xft:0 app-admin/haskell-updater:0 x11-wm/xmonad-contrib:0
 * ERROR: x11-wm/xmonad-contrib-0.11.2::gentoo failed (configure phase):
 *   //==-- Please, run 'haskell-updater' to fix outdated packages --==//
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2847:  Called haskell-cabal_src_configure '--flags=-testing' '--flags=use_xft'
 *   environment, line 2158:  Called cabal-configure '--flags=-testing' '--flags=use_xft'
 *   environment, line  490:  Called cabal-show-brokens-and-die 'setup configure failed'
 *   environment, line  561:  Called cabal-show-old
 *   environment, line  566:  Called cabal-die-if-nonempty 'outdated' 'dev-haskell/x11-xft:0' 'app-admin/haskell-updater:0' 'x11-wm/xmonad-contrib:0'
 *   environment, line  506:  Called die
 * The specific snippet of code:
 *       die "//==-- Please, run 'haskell-updater' to fix ${breakage_type} packages --==//"
 * 
 * If you need support, post the output of `emerge --info '=x11-wm/xmonad-contrib-0.11.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-wm/xmonad-contrib-0.11.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'
 * S: '/var/tmp/portage/x11-wm/xmonad-contrib-0.11.2/work/xmonad-contrib-0.11.2'

 * GNU info directory index is up-to-date.
 * After world updates, it is important to remove obsolete packages with
 * emerge --depclean. Refer to `man emerge` for more information.
storm ~ #

Now trying:

storm ~ # emerge -lav dev-haskell/x11-xft app-admin/haskell-updater                      

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-haskell/x11-xft-0.3.1  USE="-doc -profile" 0 kB
[ebuild   R    ] app-admin/haskell-updater-1.2.0.9  0 kB

Total: 2 packages (2 reinstalls), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] 

Seemed to go okay.

Then ran:

haskell-updater --all

This started to emerge 17 packages….seemed to go okay.

Magic moment…

emerge -lav x11-wm/xmonad-contrib

Seemed to work this time. Lets try update the system again:

emerge --ask --update --deep --with-bdeps=y world

Yeah that worked!! Don’t forget to run:

emerge --ask --depclean

And hope you can still reboot…….yep, I could!

Upgrading GCC

Now big updates never seem to go without a hitch, so I’m doing this one pre-emptively. Now the update command that will probably cause me issues is:

emerge --ask --update --deep --with-bdeps=y --newuse world

To packages to be updated are…

[ebuild     U  ] sys-libs/timezone-data-2013d [2013c]
[ebuild     U  ] sys-libs/libutempter-1.1.6-r1 [1.1.5] USE="-static-libs%" 
[ebuild     U  ] sys-fs/dosfstools-3.0.22 [3.0.16]
[ebuild     U  ] app-portage/portage-utils-0.30 [0.21]
[ebuild     U  ] sys-libs/mtdev-1.1.4 [1.1.3]
[ebuild     U  ] x11-libs/pixman-0.30.2 [0.28.0] USE="(-loongson2f)" 
[ebuild     U  ] x11-misc/util-macros-1.17.1 [1.17]
[ebuild     U  ] dev-libs/nss-3.15.2 [3.15.1-r1]
[ebuild     U  ] x11-proto/xproto-7.0.24 [7.0.23-r1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/xextproto-7.2.1-r1 [7.2.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild   R    ] dev-python/python-exec-0.3.1  PYTHON_TARGETS="(-pypy1_9%) (-python2_5%) (-python3_1%)" 
[ebuild     U  ] x11-proto/xf86vidmodeproto-2.3.1-r1 [2.3.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/renderproto-0.11.1-r1 [0.11.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/kbproto-1.0.6-r1 [1.0.6] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/videoproto-2.3.2 [2.3.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/damageproto-1.2.1-r1 [1.2.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/randrproto-1.4.0-r1 [1.4.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/recordproto-1.14.2-r1 [1.14.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] dev-libs/libpthread-stubs-0.3-r1 [0.3] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/compositeproto-0.4.2-r1 [0.4.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/scrnsaverproto-1.2.2-r1 [1.2.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/xf86bigfontproto-1.2.0-r1 [1.2.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/xineramaproto-1.2.1-r1 [1.2.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libpciaccess-0.13.2 [0.13.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/xf86dgaproto-2.1-r2 [2.1-r1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild   R    ] dev-libs/libxml2-2.9.1-r1  PYTHON_TARGETS="(-python2_5%) (-python3_1%)" 
[ebuild     U  ] x11-libs/libICE-1.0.8-r1 [1.0.8] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXau-1.0.8 [1.0.7] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXdmcp-1.1.1-r1 [1.1.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libdrm-2.4.46 [2.4.45]
[ebuild     U  ] x11-proto/fixesproto-5.0-r1 [5.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/rgb-1.0.5 [1.0.4]
[ebuild     U  ] x11-libs/libfontenc-1.1.2 [1.1.1]
[ebuild   R    ] dev-util/gdbus-codegen-2.32.4-r1  PYTHON_TARGETS="(-python2_5%) (-python3_1%)" 
[ebuild   R    ] virtual/python-argparse-1  PYTHON_TARGETS="(-pypy1_9%) (-python2_5%) (-python3_1%)" 
[ebuild   R    ] dev-libs/libxslt-1.1.28-r1  PYTHON_TARGETS="(-python2_5%)" 
[ebuild     U  ] x11-libs/libSM-1.2.2 [1.2.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-proto/xcb-proto-1.8-r3 [1.8-r1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/iceauth-1.0.6 [1.0.5]
[ebuild     U  ] x11-libs/libxcb-1.9.1 [1.9] USE="-xkb%" ABI_X86="(64%*) (-32) (-x32)" PYTHON_SINGLE_TARGET="python2_7%* -python2_6% -python3_2% (-python3_3)" PYTHON_TARGETS="python2_7%* python3_2%* -python2_6% (-python3_3)" 
[ebuild     U  ] x11-libs/libX11-1.6.2 [1.5.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXext-1.3.2 [1.3.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXt-1.1.4 [1.1.3] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXrender-0.9.8 [0.9.7] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXfixes-5.0.1 [5.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/xprop-1.2.2 [1.2.1]
[ebuild  NS    ] sys-devel/automake-1.11.6 [1.10.3, 1.12.6, 1.13.4]
[ebuild     U  ] x11-apps/xwininfo-1.1.3 [1.1.2]
[ebuild     U  ] x11-libs/libXxf86vm-1.1.3 [1.1.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXcomposite-0.4.4-r1 [0.4.3-r1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXrandr-1.4.2 [1.4.0] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXi-1.7.2 [1.6.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXmu-1.1.2 [1.1.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXcursor-1.1.14 [1.1.13] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXv-1.0.10 [1.0.7] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXdamage-1.1.4-r1 [1.1.3] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXpm-3.5.11 [3.5.10] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-libs/libXScrnSaver-1.2.2-r1 [1.2.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/mkfontscale-1.1.1 [1.1.0]
[ebuild     U  ] x11-libs/libXfont-1.4.6 [1.4.5-r1]
[ebuild     U  ] x11-apps/xkbcomp-1.2.4 [1.2.3]
[ebuild     U  ] x11-libs/libXres-1.0.7 [1.0.6]
[ebuild     U  ] x11-libs/libXinerama-1.1.3 [1.1.2] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/appres-1.0.4 [1.0.3]
[ebuild     U  ] x11-libs/libXtst-1.2.2 [1.2.1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] media-libs/mesa-9.1.6 [9.1.2-r1]
[ebuild     U  ] x11-apps/xset-1.2.3 [1.2.2]
[ebuild     U  ] x11-libs/libXaw-1.0.12 [1.0.11-r1] ABI_X86="(64%*) (-32) (-x32)" 
[ebuild     U  ] x11-apps/xrdb-1.1.0 [1.0.9]
[ebuild     U  ] x11-misc/xkeyboard-config-2.9 [2.7]
[ebuild     U  ] x11-apps/bdftopcf-1.0.4 [1.0.3]
[ebuild     U  ] x11-apps/xinit-1.3.3 [1.3.2]
[ebuild     U  ] x11-apps/xmessage-1.0.4 [1.0.3]
[ebuild     U  ] media-libs/freeglut-2.8.1 [2.8.0-r1]
[ebuild     U  ] x11-libs/libXft-2.3.1-r1 [2.3.1] ABI_X86="(64%*) (-32) (-x32)" 

Now lets see what breaks……

make[1]: Leaving directory `/var/tmp/portage/x11-libs/libXft-2.3.1-r1/work/libXft-2.3.1-amd64'
 * Removing unnecessary /usr/lib64/libXft.la (no static archive)
>>> Completed installing libXft-2.3.1-r1 into /var/tmp/portage/x11-libs/libXft-2.3.1-r1/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/lib64/libXft.so.2.3.1
ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/doc

>>> Installing (75 of 75) x11-libs/libXft-2.3.1-r1

 * Messages for package app-portage/portage-utils-0.30:

 * /etc/portage/postsync.d/q-reinitialize has been installed for convenience
 * If you wish for it to be automatically run at the end of every --sync:
 *    # chmod +x /etc/portage/postsync.d/q-reinitialize
 * Normally this should only take a few seconds to run but file systems
 * such as ext3 can take a lot longer.  To disable, simply do:
 *    # chmod -x /etc/portage/postsync.d/q-reinitialize

 * Messages for package x11-proto/xcb-proto-1.8-r3:

 * Please rebuild both libxcb and xcb-util if you are upgrading from version 1.6

 * Messages for package x11-libs/libXi-1.7.2:

 * Some special keys and keyboard layouts may stop working.
 * To fix them, recompile xorg-server.

 * Messages for package x11-apps/xinit-1.3.3:

 * If you use startx to start X instead of a login manager like gdm/kdm,
 * you can set the XSESSION variable to anything in /etc/X11/Sessions/ or
 * any executable. When you run startx, it will run this as the login session.
 * You can set this in a file in /etc/env.d/ for the entire system,
 * or set it per-user in ~/.bash_profile (or similar for other shells).
 * Here's an example of setting it for the whole system:
 *     echo XSESSION="Gnome" > /etc/env.d/90xsession
 *     env-update && source /etc/profile
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Regenerating GNU info directory index...
 * Processed 128 info files.
 * After world updates, it is important to remove obsolete packages with
 * emerge --depclean. Refer to `man emerge` for more information.
storm ~ # 

…nothing too worrying. Lets see what happens after a reboot!

Everything seemed okay so I ran the below.

emerge --ask --depclean
revdep-rebuild

Again all seemed good so I carried on with my normal business. While trying to figure out and audio issue I have, I ran the following command and saw some strange output from emerge.

emerge --info alsa-plugins

The output was.

!!! No gcc found. You probably need to 'source /etc/profile'
!!! to update the environment of this terminal and possibly
!!! other terminals also.
Portage 2.2.1 (default/linux/amd64/13.0/desktop, [unavailable], glibc-2.15-r3, 3.8.13-gentoo x86_64)

Something doesn’t seem quite right!

storm ~ # gcc-config -l
 * gcc-config: Active gcc profile is invalid!

 [1] x86_64-pc-linux-gnu-4.7.3

Then I make sure all configuration files had been regenerated.

storm ~ # gcc-config -f 1
 * Switching native-compiler to x86_64-pc-linux-gnu-4.7.3 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                  [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

storm ~ #

That seems better.

storm ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-4.7.3 *
storm ~ # 

Don’t forget to run the below just in case.

. /etec/profile

But that seemed to fix it – no “no gcc found” errors in my emerge output.