Howto upgrade Gentoo 2007.0 to the latest version
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
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
Oh one thing to note is that it may error if the kernel source tarball from
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
IMHO better than trying to deal with blocks and profile changes when upgrading from an older installation.
Rich.
@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.
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.
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
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).