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…

4 Responses to “upgrading a gentoo box that hasn’t been upgraded since 2007”

  1. May 12th, 2009 | 12:15
    Using Debian IceWeasel Debian IceWeasel 3.0.9 on Debian GNU/Linux Debian GNU/Linux

    A true Gentoo wizard!

  2. May 13th, 2009 | 09:03
    Using WordPress WordPress 2.7

    […] Another fellow blogger created an interesting post today on Î […]

  3. Arie
    May 27th, 2009 | 19:38
    Using Mozilla Firefox Mozilla Firefox 3.0.10 on Windows Windows Vista

    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.

  4. Daniel
    May 29th, 2009 | 19:32
    Using Mozilla Firefox Mozilla Firefox 3.0.5 on Gentoo Linux Gentoo Linux

    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
    }

Leave a reply