Gentoo: Tips to upgrade your really old installation
Let me start out this post by making it clear. You should really upgrade your Gentoo installation on a regular basis. If not, you might run into some problems.
This post attempts to help out someone that is trying to bring an unmaintained installation up to date. Under most circumstances it is probably easier to reinstall after a certain point. These instructions have been created by an active contributor to Gentoo, Nick Fortino, to take a 2006.1 installation and update it to a current stable system. (Which I hope is much more extreme than anyone needs).
Version 0, written by Nick Fortino
#March 23, 2009
#This has been tested only in chroot, bringing 2006.1-amd64-stage3 upto
#a stable amd64 system
#This is an experimental guide on how to upgrade an old system to get to
#portage 2.1.6.7. Once this state is achieved, portage can do the rest, with
#decent dependency resolution.
###########################################################################
#Between the first tar command and the success of 'emerge -uDN system', the
#true state of the system, and the state according to portage are different.
#This is rather unsafe, so be sure you understand what you are doing.
#Consider this your big red warning to backup important files before attempting
#an update, and consider a re-install if possible.
###########################################################################
#It may be wise to use the default make.conf, as we would like to rebuild
#as few packages as possible before the toolchain has been updated, and use
#flags will bring in a bunch of dependencies
#Update the symlink to an existing profile
unlink /etc/make.profile
ln -s ../usr/portage/profiles/default/linux/amd64/2008.0 /etc/make.profile
#Fetch and forcefully upgrade python, bash, and portage with prebuilt sources
wget http://tinderbox.dev.gentoo.org/default-linux/amd64/dev-lang/python-2.5.2-r7.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/amd64/app-shells/bash-3.2_p39.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/amd64/sys-apps/portage-2.1.6.7.tbz2
cd /
tar xfpj root/python-2.5.2-r7.tbz2
tar xfpj root/bash-3.2_p39.tbz2
tar xfpj root/portage-2.1.6.7.tbz2
#remove the obsolete block from bash for portage; we got around it with a binary
#update (adding to /etc/portage/profile/package.provided would seem more
#elegant, but doesn't work?)
cd /usr/portage/app-shells/bash
nano /usr/portage/app-shells/bash/bash-3.2_p39.ebuild
repoman manifest
cd /
#See what will be upgraded, there should be no unresolved blockers
emerge -puDNv system
#Perform the update, this command will likely make good progress, and then fail
emerge -uDN system
############
#Known failures and solutions
############
#Cracklib wants -unmerge-orphans
FEATURES='-unmerge-orphans' emerge -1 cracklib
#continue the upgrade
emerge -uDN system
#Python updater and python split, creating a confilct, resolve by removing
#the old file
rm /usr/sbin/python-updater
emerge -1 python-updater
#continue the upgrade
emerge -uDN system
############
#Cleanup
############
#Update the current terminal
env-update
source /etc/profile
#Deal with the many /etc files which need updating
emerge gentoolkit
dispatch-conf
#At this point, the toolchain has been rebuilt, which likely involved an upgrade
#of gcc. Follow http://www.gentoo.org/doc/en/gcc-upgrading.xml to finish the
#upgrade. A lot of what is requested there has likely been done automatically,
#so in summary:
#Check that gcc-config is using the correct compiler, if not, follow the above
#guide
gcc-config -l
#Replace your make.conf/update to whatever profile you choose/etc.
#Rebuild the system with the new toolchain, and custom settings
emerge -eav system
#Rebuild and update world with new toolchain and settings
emerge -eav world
#Finally, remove any old packages which still survived the process
emerge --depclean -a
Which I made available here.
So, please people. Update on a regular basis so you don't have to go through this stuff.




I am missing the definition of what "on a regular basis" means. I update my system only in case there are any security issues or there is a new kernel available and run a true full update perhaps once a year. I have not experienced big trouble.
Well, I intentionally left that detail out because it is not a strict timeline. Some say once a year, some say every 6 months.
If you keep portage up to date, you will have the least troubles.
@richard
I think you can say a regular basis is at least once every profile-update (i.e. once every "release").
But to be on the safe side I would say at least once every month for packages that may not need reconfigurations, and those other (like apache, php) when you have the time. But looking at which of them usually have security issues, if you update those packages I think you're on the safe side.
does not
BINHOST="http://tinderbox.dev.gentoo.org/default-linux/amd64/All" emerge --usepkg-only --nodeps python bash portage
work? Or something like that, I had not the time looking up the exact syntax/URL.
I don't know how emerge handles EAPI in tbz2's but I assume the same as normal. So, no, that would not work because you would still have "masked via EAPI" if your portage version is too old.
How does this script handle "breakers" like expat upgrade and the "mktemp blocking coreutils" thing?
What about monolithic vs split? Do newer version of portage handle those problems automagicly?
Based on Nick's testing, I guess it works fine. Once you get a newer portage, most blockers will be resolved automatically.
All of the famous blockers I know of seem to be handled well by >=portage-2.1.6.7. That is the entire crux of the method proposed here. The only kind of blockers I know of which aren't resolved are the form:
upgraded A needs upgraded B
old C needs B to not be upgraded, so the upgrade is blocked.
Luckily, this one is easy, upgrade A and C together.
There is a small issue in your manual I don't understand.
Remove the obsolete block for bash. I removed this sign # before the sentence in nano /usr/portage/...Is this all?
After the repoman manifest the following message appears:
sh: /lib/libc.so.6: version 'GLIBC_2.4' not found (reguired by sh)
sh: /lib/libc.so.6: version 'GLIBC_2.4' not found (required by sh)
/bin/bash: /lib/libc.so.6: version 'GLIBC_2.4' not found (required by /bin/bash)
!!! getFetchMap():aux_get() error reading app-shells/bash-3.2_p39; aborting.
Unable to generate manifest.
I tried your script on mpentoo 2006.1
TIA,
CC
I don't really have a good idea on this one. It seems you are either:
a) Using a setup which is even older than this guide is intended for
b) the mpentoo file layout is different from the gentoo layout, in ways which break binary packages.
I tried the obvious solution of attempting to also pull in the binary glibc from tinderbox.gentoo.org, but that (rather predictably) causes far more issues than it solves. You could try pulling in packages from tinderbox.gentoo.org until it works, but at this point you are essentially doing a reinstall, so why not actually do a reinstall?
Other than that, I don't have any helpful advice. Trying to switch between distributions by taking a very old image from one and upgrading to the other sounds like a very dicey proposition in the first place.
#remove the obsolete block from bash for portage;
What obsolete block are you referring to that needs to be removed. Is there something to uncomment that I'm missing?
No, you aren't missing anything to uncomment, the nano command was intended to bring up an editor so you can manually do it. An equivalent non-interactive command is:
sed -i '/sys-apps\/portage-2.1.5/d' bash-3.2_p39.ebuild
which simply deletes the line the comment intends for you to find yourself.
Pretty slick. Couldn't you use --nodeps instead of that blocker ebuild hack?
There are likely many --nodeps hacks that could be done, but not all of them are safe.
The problem is Portage thinks <Portage-2.1.5 is installed, but it's wrong. One could inform it of the truth via emerge --nodeps portage, but this would recompile portage with old dependencies (only python and bash are fixed at this point), so that seems to be a worse hack than the bash one. The slick solution is likely to steal xake's idea, and do something along the lines of:
#Start from the top
...
tar xfpj root/portage-2.1.6.7.tbz2
#Now re-emerge, but inform portage of what we are doing
BINHOST="http://tinderbox.dev.gentoo.org/default-linux/amd64/All" emerge --usepkg-only --nodeps python bash portage
#Skip bash hackary, and continue
This should be tweaked further to not download from tinderbox.d.g.o twice, but I don't have the 5 minutes to paw through man pages to do it right now.
I took it to mean that the bash ebuild blocks portage-2.1.5 as evident in bash-3.2_p39.ebuild:
RDEPEND="${DEPEND}
!<sys-apps/portage-2.1.5
!<sys-apps/paludis-0.26.0_alpha5"
I changed this to
RDEPEND="${DEPEND}
!<sys-apps/paludis-0.26.0_alpha5"
and then continued with the steps described above. It worked.
i am using gentoo with gnome 2.24 want to upgrade to 2.26 and how to or what must i do ????
thanks
Heh, please use the normal Gentoo support channels for such questions. There is #gentoo on freenode and gentoo-user@lists.gentoo.org mailing lists that you can subscribe to. A simple google search will find this for you: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=3
Pretty slick. Couldn't you use --nodeps instead of that blocker ebuild hack?
I actually have a Gentoo install that hasn't been updated since August 2005. The hard drive has been in a drawer. I should just wipe and reinstall, but it would be fun to try updating. Unfortunately, I forgot most of the Gentoo tricks and what I remember might not be valid any more.
heh, good luck
Had you any luck with that? I am in need to upgrade Gentoo from end of year 2005.
I got an error
repoman manifest
File "/usr/bin/repoman", line 366
allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_"))
^
SyntaxError: invalid syntax
What can I do with that?.
And then again:
jack ~ # emerge -puDNv system
Traceback (most recent call last):
File "/usr/bin/emerge", line 29, in ?
import _emerge
File "/usr/lib/portage/pym/_emerge/__init__.py", line 507
result = list(x for x in matches if portage.cpv_getkey(x) == cp)
^
SyntaxError: invalid syntax
Ok, I cured it
Wrong version of Python was used.
jack bin # ln -s python2.5 python
jack bin # ln -s python2.5 python2
ha, ok.
If you do this and run into com_err, ss, e2fsprogs issues, go no further & read this: http://forums.gentoo.org/viewtopic-t-712898-postdays-0-postorder-asc-start-0.html
Save yourself a broken system like I got. :/
Also, a note about the step involving the bash ebuild file: I had no idea what you meant, so I just nano'd it & closed it on all three systems and kept going. After reading the posts, still not sure. repoman seeems to be the important bit there? Because everything else seems to be working and the EAPI blocks are gone.
The comment above it says to remove the obsolete block. so, remove !< sys-apps/portage-2.1.5
looks like you saved my old mail server - no updates for many many months / years. please give yourself 3 green ticks or a gold star - or a line of something....
... anyways thank you
hopefully 25 people wont be pissed off with me in the morning
well - it took some hours and a final reboot with fingers crossed - but my mail server is up to date running fine, thank you, thank you, thank you
Glad you found something that worked.
Freaking awesome!
I just ran [emerge --sync] to update a 2006 profile, after which all hell broke loose when trying to subsequently [emerge portage]. After running this script I was able to I ran into a very few blocked packages when trying to [emerge portage], which I resolved by emerging the problem packages independently with the [--nodeps] option. Thereafter I was able to [emerge portage] and [emerge --update --deep --newuse world] with no problems! I'm now on the latest Gentoo everything as of the date of this post (amd64/10.0).
Nick Fortino for U.S. President 2012!
Thanks to this post a Gentoo 2007.0 untouched for more than a year and half has successfully been updated - and an almost retired laptop has come back to life!
Thanks a lot,
Eduardo