Howto upgrade Gentoo 2007.0 to the latest version

Hi,

After many hours of testing I've finally come up with a script to upgrade a Gentoo 2007.0 server available via Linode.

Deploy a standard Gentoo 2007.0 image from the Linode Distribution Wizard then SSH in as root and create a script with the following content:

#!/bin/bash
#
# update portage tree
#
emerge --sync

#
# Fix the Bash/Portage blocker
#
emerge -1 =app-shells/bash-3.2_p17-r1
emerge portage lzma-utils
emerge bash

#
# Fix the mktemp/coreutils/util-linux blocker
#
emerge -C mktemp util-linux
emerge coreutils util-linux
hash -r

#
# Fix the ss/com_err/e2fsprogs/e2fsprogs-libs blocker
#
emerge -f e2fsprogs e2fsprogs-libs
emerge -C ss com_err e2fsprogs
emerge e2fsprogs

#
# Merge in all /etc updates
#
echo "-5" | etc-update

#
# Now go get a kernel source tarball
#
wget --quiet -O /dev/stdout http://www.linode.com/src/$(uname -r).tar.bz2 | tar xjvp -C /usr/src
cd /usr/src
ln -s $(ls) linux
cd linux
zcat /proc/config.gz > .config
make oldconfig && make && make modules_install && depmod

#
# Updating CFLAGS
# See: http://www.linode.com/forums/viewtopic.php?t=3267
#
sed -i s/-pipe/-mno-tls-direct-seg-refs/ /etc/make.conf

#
# Remove cracklib as it doesn't upgrade nicely
#
emerge -C cracklib

#
# Now rebuild your whole system :-)
#
for type in system world ; do
  emerge -e ${type}
  while [ $? -gt 0 ]; do
    emerge --resume -e ${type}
  done
done

Now chmod +x that script and then run it:

# chmod +x myscript
# ./myscript

You will soon have the latest and greatest version of Gentoo… well, in a few hours anyway :wink:

Each time I have ran this script it has worked for me. No doubt there will be other package blockers in the future that this script doesn't cover so you'll have to figure that out on your own :lol:

Oh one thing to note is that it may error if the kernel source tarball from http://www.linode.com/src doesn't end in tar.bz2. I noticed tonight that some of the newer ones seem to be ending in tar.gz

I hope this helps someone as I think Linode is a great match with Gentoo Perhaps it can be used to help create a Gentoo 2008.0 install image??

Cheers,

Rich

7 Replies

I preferred using Finix recovery, mounting the partitions and doing a straight stage3 install from latest tarballs. As soon as you unpack the tarballs and configure some basic things (network, ssh), you can reboot into stage3 and proceed (re)building world from there.

IMHO better than trying to deal with blocks and profile changes when upgrading from an older installation.

I think that this thread will not be that relevant any more now that Gentoo 2008.0 is available to deploy.

Rich.

Gentoo 2008.0 is old by now. Plenty of changes in between, not to mention no ext4 support.

@Azathoth:

Gentoo 2008.0 is old by now. Plenty of changes in between, not to mention no ext4 support.

It may be old, but I don't believe it will suffer with the "ss com_err e2fsprogs" problems of the past that this thread helps resolve.

Rich.

Gentoo 2008.0 does suffer from e2fsprogs block, iirc, and you do solve that in your script.

All I'm saying is that I prefer booting finix, downloading the two tarballs, unpacking them, and I'm ready to boot into latest gentoo installation. IMHO that's better and faster approach than having to babysit the rebuild in case there are upgrade failures. :wink:

ah, I see.. fair point well made :)

I've never looked into what I need to do to get a kernel on a linode when doing things the manual way, so always gone for the "upgrade from within" method.

Rich

Also please note that there are no more major releases. There will be no 2009.x or 2010.x. The official recommended installation procedure now is to use weekly stage3 tarballs, stage3 live CDs (minimal install included) if applicable, and latest portage tarballs.

One more thing, there are at least two upgrades to glibc and at least one upgrade to gcc, if not more, since 2008.0. That alone requires rebuilding gcc+glibc, then rebuilding world again, aside to profile updates (also Python upgraded a few times), which might take an hour or so.

Also syslog-ng has been upgraded to version that breaks old syslog config (regex matching).

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct