Gentoo: Upgrade the Linux Kernel

I have not updated my kernel for a while. As you can see, I will be updating from version 3.8.13-gentoo to version 3.10.7-gentoo-r1.

storm ~ # ls -la /usr/src
total 20
drwxr-xr-x  5 root root 4096 Oct  1 22:32 .
drwxr-xr-x 14 root root 4096 Aug 19 03:40 ..
-rw-r--r--  1 root root    0 Aug  1 04:16 .keep
lrwxrwxrwx  1 root root   19 Aug  6 05:40 linux -> linux-3.8.13-gentoo
drwxr-xr-x 24 root root 4096 Aug 22 22:22 linux-3.10.7-gentoo
drwxr-xr-x 24 root root 4096 Oct  1 22:33 linux-3.10.7-gentoo-r1
drwxr-xr-x 24 root root 4096 Aug 31 22:21 linux-3.8.13-gentoo
storm ~ # 

As I am skipping a couple of kernels, I will not attempt to use the old .config file with the new kernel.

Update the Kernel Symbolic Link

You can update the symbolic link a number of ways, see the official documentation for more information.

Using eselect

I prefer to use eselect as its quicker and easier. If you don’t already have it you will need to install it first.

emerge eselect

Once installed, list the available kernels with.

storm ~ # eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.8.13-gentoo *
  [2]   linux-3.10.7-gentoo
  [3]   linux-3.10.7-gentoo-r1
storm ~ # 

Select the new kernel.

eselect kernel set 3

Then check with either.

storm ~ # eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.8.13-gentoo
  [2]   linux-3.10.7-gentoo
  [3]   linux-3.10.7-gentoo-r1 *
storm ~ # 

Or.

storm ~ # ls -la /usr/src/linux
lrwxrwxrwx 1 root root 22 Oct 11 15:24 /usr/src/linux -> linux-3.10.7-gentoo-r1

Manually Update Symbolic Link

You can also just do it manually with.

cd /usr/src
ln -sfn linux-3.10.7-gentoo-r1 linux

The s option is to create the soft link, the f to force, and the n to treat link no differently than a normal directory.

Configure the New Kernel

Run menuconfig and make the relevant selection.

cd /usr/src/linux
make menuconfig

Link to required kernel options page

Compile and Install the New Kernel

cd /usr/src/linux
make && make modules_install
mount /boot
cp -v arch/x86_64/boot/bzImage /boot/kernel-3.10.7-gentoo-r1

Rebuilt initramfs Image and Grub Configuration

mount /boot
genkernel --lvm --mdadm initramfs
grub2-mkconfig -o /boot/grub/grub.cfg
reboot

And cross your fingers!

Resources

Gentoo.org: Gentoo Linux Kernel Upgrade Guide
http://www.gentoo.org/doc/en/kernel-upgrade.xml

Wiki.gentoo.org: Kernel/Upgrade
http://wiki.gentoo.org/wiki/Kernel/Upgrade

Negativesum.net: Gentoo Kernel Upgrade Guide
http://negativesum.net/tech/linux/gentoo/kernel

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.

Removing LVM2 Partitions and RAID Devices

LVM Partitions

If you decide to start your installation from the beginning (or installing another OS), you will first need to remove the LVM2 partitions and the RAID devices.

To do that, boot into a Gentoo Live DVD, at the boot menu, navigate to Gentoo x86 amd64 and press tab. At the end of the boot options, add dolvm domdadm.

Once within the LiveDVD, run something similar to the below, replacing the names to match yours. Note, you should not attempt his while any of the partitions are mounted!

lvremove -v /dev/vgssd/{lvboot,lvroot} && lvremove -v /dev/vghdd/{lvhome,lvusrportage,lvvar,lvvhdd}

Spoiler

Gentoo-20121221 ~ # lvremove -v /dev/vgssd/{lvboot,lvroot} && lvremove -v /dev/vghdd/{lvhome,lvusrportage,lvvar,lvvhdd}
Using logical volume(s) on command line
Do you really want to remove active logical volume lvboot? [y/n]: y
Creating directory “/etc/lvm/archive”
Archiving volume group “vgssd” metadata (seqno 3).
Found volume group “vgssd”
Removing vgssd-lvboot (253:4)
Releasing logical volume “lvboot”
Creating directory “/etc/lvm/backup”
Creating volume group backup “/etc/lvm/backup/vgssd” (seqno 4).
Logical volume “lvboot” successfully removed
Do you really want to remove active logical volume lvroot? [y/n]: y
Archiving volume group “vgssd” metadata (seqno 4).
Found volume group “vgssd”
Removing vgssd-lvroot (253:5)
Releasing logical volume “lvroot”
Creating volume group backup “/etc/lvm/backup/vgssd” (seqno 5).
Logical volume “lvroot” successfully removed
Using logical volume(s) on command line
Do you really want to remove active logical volume lvhome? [y/n]: y
Archiving volume group “vghdd” metadata (seqno 5).
Found volume group “vghdd”
Removing vghdd-lvhome (253:0)
Releasing logical volume “lvhome”
Creating volume group backup “/etc/lvm/backup/vghdd” (seqno 6).
Logical volume “lvhome” successfully removed
Do you really want to remove active logical volume lvvhdd? [y/n]: y
Archiving volume group “vghdd” metadata (seqno 6).
Found volume group “vghdd”
Removing vghdd-lvvhdd (253:1)
Releasing logical volume “lvvhdd”
Creating volume group backup “/etc/lvm/backup/vghdd” (seqno 7).
Logical volume “lvvhdd” successfully removed
Do you really want to remove active logical volume lvvar? [y/n]: y
Archiving volume group “vghdd” metadata (seqno 7).
Found volume group “vghdd”
Removing vghdd-lvvar (253:2)
Releasing logical volume “lvvar”
Creating volume group backup “/etc/lvm/backup/vghdd” (seqno 8).
Logical volume “lvvar” successfully removed
Do you really want to remove active logical volume lvusrportage? [y/n]: y
Archiving volume group “vghdd” metadata (seqno 8).
Found volume group “vghdd”
Removing vghdd-lvusrportage (253:3)
Releasing logical volume “lvusrportage”
Creating volume group backup “/etc/lvm/backup/vghdd” (seqno 9).
Logical volume “lvusrportage” successfully removed
Gentoo-20121221 ~ #

[collapse]

vgremove -v vghdd vgssd

Spoiler

Gentoo-20121221 ~ # vgremove -v vgssd vghdd
Using volume group(s) on command line
Finding volume group “vgssd”
Archiving volume group “vgssd” metadata (seqno 5).
Removing physical volume “/dev/md125” from volume group “vgssd”
Volume group “vgssd” successfully removed
Finding volume group “vghdd”
Archiving volume group “vghdd” metadata (seqno 9).
Removing physical volume “/dev/md127” from volume group “vghdd”
Volume group “vghdd” successfully removed
Gentoo-20121221 ~ #

[collapse]

pvremove /dev/{md125,md126,md127}
Spoiler
Gentoo-20121221 ~ # pvremove /dev/{md125,md126,md127}
  Labels on physical volume "/dev/md125" successfully wiped
  No physical volume label read from /dev/md126
  Physical Volume /dev/md126 not found
  Labels on physical volume "/dev/md127" successfully wiped
Gentoo-20121221 ~ #

[collapse]

Note, /dev/md126 was the swap drive and so not attached to the LVM.

RAID Devices

swapoff /dev/md126
mdadm --stop /dev/md{125,126,127}
mdadm --remove /dev/md{125,126,127}
Spoiler
Gentoo-20121221 ~ # swapoff /dev/md126
Gentoo-20121221 ~ # mdadm --stop /dev/md125
mdadm: stopped /dev/md125
Gentoo-20121221 ~ # mdadm --stop /dev/md126
mdadm: stopped /dev/md126
Gentoo-20121221 ~ # mdadm --stop /dev/md127
mdadm: stopped /dev/md127
Gentoo-20121221 ~ # mdadm --remove /dev/md125
Gentoo-20121221 ~ # mdadm --remove /dev/md126
Gentoo-20121221 ~ # mdadm --remove /dev/md127

[collapse]

This should wipe the bio_grub partitons.

mdadm --zero-superblock /dev/sd{a1,b1}

However, this didn’t not appear to work for me.

Spoiler
Gentoo-20121221 ~ # mdadm --zero-superblock /dev/sd{a1,b1}
mdadm: Unrecognised md component device - /dev/sda1
mdadm: Unrecognised md component device - /dev/sdb1

[collapse]

……..but hopefully won’t be an issue……..(it wasn’t.)

After that, you just need to remove the partitions as normal then reboot. I normally use GParted but you can use whatever you like.

Gentoo: Amend Global USE Flags

Here I need to amend the global USE flag to allow for Native Language Support (nls).

nano /etc/portage/make.conf

Now just add nls to the end of the USE flag variable. For example, USE=".... nls".

Then update all the system software, pulling in support for nls where necessary.

emerge --update --deep --newuse --ask world
emerge -p --depclean

If that seems okay, run without the “pretend” option on.

emerge --depclean
reboot

Job done!

“Spinning up” a Rackspace Cloud Server

Assuming you’ve already created yourself a Rackspace cloud account and that you’ve just logged in, you will see a list of cloud servers (if you have any yet). These are your current servers. If a server is listed here, you will be getting charged for it at an hourly rate. Even if you shutdown your server through the Operating System! To avoid getting charged for something you are not using, take a snapshot and then delete it. You can always build a new server instance from that snapshot at a later point in time when it is required.

Servers tab
Servers tab

To create a new server, you simply click “create server“, then provide the following information.

Server name:
Region:
Image:
Size:
Networks:

Once filled out, kick the build process off by clicking “create server” at the bottom of the page.

Select flavour and instance type
Select flavour and instance type

The server will then go into “building” state until complete when it then goes into “active". Although it only takes a few minutes to be deployed, you are free to continue using other parts of the website. You can even spin up more servers while you wait if you want!!

Building server
Building server

And that is it! Your first cloud server! Easy!

Your new server details
Your new server details

How to connect to your new cloud server depends on what Operating System you chose to install, Windows or Linux? If you chose Linux, you will need to use SSH. If Windows, you can use RDP. Here we chose CentOS – which is essentially just a free, re-branded release of Red Hat Enterprise Linux. If using SSH, issue below command.

[root@server ~]# ssh root@1.2.3.4

Don’t forget to replace 1.2.3.4 with the public IP address of your cloud server!

Installing WordPress on a Rackspace Linux Cloud Server

Assuming you’ve already “spun-up” a Linux cloud server of your choice, the first thing to do is update the system. I’m using CentOS because it’s free and binary compatible with Red Hat Enterprise Linux (RHEL).

SSH onto your box with the below command, replacing the IP address with that of your server. You will need to accept the key when prompted.

Gentoo-20121221 ~ #

ssh root@120.201.75.117

The authenticity of host '120.201.75.117 (120.201.75.117)' can't be established.
RSA key fingerprint is d3:18:87:29:fe:05:4d:13:ee:75:76:g8:c0:d8:1z:81.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '120.201.75.117' (RSA) to the list of known hosts.
root@120.201.75.117's password:
[root@hagman ~]#

Then update the system and reboot if needed.

[root@hagman ~]# yum check-update
[root@hagman ~]# yum update
[root@hagman ~]# reboot

Install the required software:

  • The Apache web server
  • MySQL database server
  • PHP

Fortunately this can be done with one command.

[root@hagman ~]# yum install mysql-server httpd php php-mysql

Make sure that php-common is also pulled in as a dependency before confirming the installation. If unsure, you can run:

[root@hagman ~]#

rpm -qa | grep php

php-common-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-5.3.3-22.el6.x86_64

Configuring MySQL

Here we start the MySQL server process, secure it, and then connect to the database and prepare it for the WordPress installation. Lastly we add the service to the default run-level. We validate that all services start on boot towards the end of this document, when we reboot to test the WordPress installation for the final time.

The below command will start the service.

[root@hagman ~]# service mysqld start

Now we secure MySQL.

[root@hagman ~]#

mysql_secure_installation

Enter current password for root (enter for none):
Set root password? [Y/n]: Y
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

[root@hagman ~]#

Now we create a database for WordPress to use. First we need to create a system user to grant with privileges on the database.

[root@hagman ~]# useradd wordpress-db-usr
[root@hagman ~]# passwd wordpress-db-usr
[root@hagman ~]# mysql -p
Enter password: root_mysql_password

Once successfully logged in as the root database user, create the database and grant privileges. Pay close attention to the characters used, “`“, instead of “” most of the time.

mysql> CREATE DATABASE `wp-db`;
mysql> GRANT ALL PRIVILEGES ON `wp-db`.* TO `wp-db-usr`@localhost IDENTIFIED BY 'wp_user_db_passwd';
mysql> FLUSH PRIVILEGES;
mysql> EXIT

Lastly we add the MySQL daemon to the boot process.

[root@hagman ~]# service mysqld status
mysqld (pid 4073) is running...
[root@hagman ~]# chkconfig mysqld --list
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@hagman ~]# chkconfig mysqld on

[root@hagman ~]# chkconfig mysqld --list
mysqld 0:off 1:off

2:on 3:on 4:on 5:on

 6:off
[root@hagman ~]#

Configure Apache

Now we need to start Apache but to avoid seeing a warning message like the one below, we need to first set the ServerName directive in the httpd.conf.

[root@hagman ~]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 2001:4800:7814:0:9948:8a2e:ff05:172f for ServerName

To set the directive, open up the Apache configuration file with a text editor.

[root@hagman ~]# service httpd status
httpd is stopped
[root@hagman ~]# nano /etc/httpd/conf/httpd.conf

Uncomment out the ServerName directive to look like this:

ServerName localhost

Now start (or restart if already running) the Apache service.

[root@hagman ~]# service httpd start
Starting httpd: [ OK ]

Now lets add Apaches httpd process to the default run-level.

[root@hagman ~]# chkconfig httpd --list
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@hagman ~]# chkconfig httpd on

[root@hagman ~]# chkconfig httpd --list
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@hagman ~]#

Install WordPress and Configure Apache

If you plan on creating multiple vhost sites, create a separate directory to hold the WordPress files. The below commands do just that. We also download the latest version of WordPress, extract it, clean up a little and then the last line just removes the (hopefully empty) folder called wordpress.

[root@hagman ~]# mkdir /var/www/html/pikedom-wp
[root@hagman pikedom-wp]# cd /var/www/html/pikedom-wp
[root@hagman pikedom-wp]# wget http://wordpress.org/latest.tar.gz
[root@hagman pikedom-wp]# tar -xzvf latest.tar.gz
[root@hagman pikedom-wp]# rm -v latest.tar.gz
[root@hagman pikedom-wp]# mv -v wordpress/* .
[root@hagman pikedom-wp]# rmdir -v wordpress/

We also need to change the permissions so that apache has both owner and group access rights over the whole site.

[root@hagman pikedom-wp]# chown -Rv apache:apache /var/www/html/pikedom-wp

Here we create a WordPress configuration file from the supplier sample. We also remove the read permission for other.

[root@hagman pikedom-wp]# cp wp-config-sample.php wp-config.php
[root@hagman pikedom-wp]# chmod -v o-r wp-config.php
[root@hagman pikedom-wp]# nano wp-config.php

I changed the below parts.

define('DB_NAME', 'wp-db');
define('DB_USER', 'ifiwerepm-db-usr');
define('DB_PASSWORD', 'wp_user_db_passwd');
define('DB_HOST', 'localhost');

define('AUTH_KEY',         'BhewLNMhybYW[LaGOwHup&rqc;ZDtD6TTrjL;tkPo4LrYglmpS' );
define('SECURE_AUTH_KEY',  'q:rA7YIJaFljQCypOsbnLz{nOdBwmxO8PB;biyt?uYEOhQUfaL' );
define('LOGGED_IN_KEY',    'JKNZK:onwheckZfsljyX[xeQ6aLJHc]hz-hJSBA4woMBQxRuzT' );
define('NONCE_KEY',        'TpoRX?XbN$ZpFrGryr"kiCiF6QbZgFjVDRaC/xPgl6UozabJwn' );
define('AUTH_SALT',        'HtXyIleIlTt2EnVuyqwZgG-khhI{NtHVBT9wf.fY?CrXefBJqo' );
define('SECURE_AUTH_SALT', 'BHlKtVFPLlOF(sqcy'R{zSFDTmhCio4vg6Wa%rgfIShtOhskfX' );
define('LOGGED_IN_SALT',   '7jSeHszKlCluRzW@=qkyAaqD_dDFd*gFplguHBNtqBABVVu1rV' );
define('NONCE_SALT',       'TqnfxC7TPae6UhfzA>ZuwAmbHDnNiYteLCI}ziJazbJHxDqN:w' );

$table_prefix  = 'pikedom_';

Now we create an Apache configuration file for the site.

nano /etc/httpd/conf.d/pikedom-wp.conf

Create something like this. Save and exit.

ServerAdmin test@test
DocumentRoot /var/www/html/pikedom-wp
ServerName www.pikedom.com

# Logging
ErrorLog /var/log/httpd/wordpress-error-log
CustomLog /var/log/httpd/wordpress-access-log common

Note, the email address, test@test gets included in any error messages sent to the client. Official documentation recommends that you create an email address for that specific purpose. www-admin@yourdomain.com for example.

Reboot and Check Services

Now reboot to check that everything still works.

shutdown -r now

From another computer, try to access the site by entering the IP address in a web browser.

http://120.201.75.117/wp-admin/install.php

If all went well, you should see a page similar to the below.

pic

All you need to do now is configure your DNS settings so that others can find your site by typing the domain name instead of the IP address.

If you do not get the response you were expecting, make sure that Apache and MySQL are still running. If not, you need to make sure the services are starting at boot.