12/05/2009
upgrading a gentoo box that hasn’t been upgraded since 2007
I was given root today in a gentoo box that nobody had upgraded since 2007. As expected the “emerge –sync; emerge -uDavt world” showed a lot of blockages.
I tried to solve each one but I got stuck while trying to upgrade portage 2.1.3.9 to 2.1.6.11. In order to upgrade portage I had to upgrade sandbox, but sandbox couldn’t be ugraded correctly due to portage 2.1.3.9 being unable to handle .tar.lzma files.
The box had sandbox-1.2 installed and it was unable to upgrade to sandbox-1.6. The error was:
unpack sandbox-1.6.tar.lzma: file format not recognized. Ignoring.
Upgrading lzma-utils, tar and a few other packages did not work. In the end I edited the sandbox-1.6-r2.ebuild and changed the src_unpack function from:
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${P}-disable-qa-static.patch
epatch "${FILESDIR}"/${P}-disable-pthread.patch
epatch "${FILESDIR}"/0001-libsandbox-handle-more-at-functions.patch
}
To:
src_unpack() {
unpack ${A}
cd /var/tmp/portage/sys-apps/sandbox-1.6-r2/
tar --lzma -xvf sandbox-1.6.tar.lzma
mv sandbox-1.6/ work/
cd "${S}"
epatch "${FILESDIR}"/${P}-disable-qa-static.patch
epatch "${FILESDIR}"/${P}-disable-pthread.patch
epatch "${FILESDIR}"/0001-libsandbox-handle-more-at-functions.patch
}
Then:
cd /usr/portage/sys-apps/sandbox/; ebuild sandbox-1.6-r2.ebuild manifest
After this edit, sandbox emerged properly, so portage emerged properly too. Everything else worked as expected…
Filed by kargig at 12:13 under Gentoo,Linux
Tags: Gentoo, Linux, lzma, portage, sandbox, upgrade
4 Comments | 9,621 views
A true Gentoo wizard!
[…] Another fellow blogger created an interesting post today on Î […]
Another workaround I just found was to first run emerge -a1 portage (which bombed out almost at the end with an error along the line of “more than 1 value needed to unpack”. Running emerge -av portage then with its dependencies worked fine.
Thanks! I had to tweak it slightly to work:
src_unpack() {
unpack ${A}
cd /var/tmp/portage/sys-apps/sandbox-1.6-r2/work
tar –lzma -xvf ../distdir/sandbox-1.6.tar.lzma
cd “${S}”
epatch “${FILESDIR}”/${P}-disable-qa-static.patch
epatch “${FILESDIR}”/${P}-disable-pthread.patch
epatch “${FILESDIR}”/0001-libsandbox-handle-more-at-functions.patch
}