Upgrading from Debian 32 bit to 64 bit

I got a new Intel core i7 computer and migrated my Debian server over to it. Here’s how to do it without installing from scratch:

First off, read this article. I followed the instructions and only deviated in a couple places.

I found that during the 64-bit libc install I had to run

dpkg --force-architecture -i libc6-i386_2.7-18_amd64.deb libc6_2.7-18_amd64.deb

instead of:

dpkg --force-architecture -i libc6-i386_2.7-18_amd64.deb

Yeah, even though libc6-i386_2.7-18_amd64.deb had already been installed.

Cheating with a chroot

One thing I did in addition to what the article suggested was to build a chroot for 64 bit stuff so I could download things with ease.

debootstrap --arch=amd64 lenny `pwd`/root64

Then,

chroot root64

From there I could “apt-get install” and look through dependencies and none of it was impacted by the state of my main machine. Apt gets screwed up for a while in the process and it was helpful to go find what a packages real dependencies were.

In particular I did “apt-get install ia32-libs” which got all the compat libraries. From there I could go into root64/var/cache/apt/archives/ and get right to the .deb files.

I also used aptitude to resolve many of the apt-get -f install problems (once I had reinstalled enough by hand to stop the ELFCLASS errors).

apt-get -f install

My biggest “apt-get -f install” problem was some old java stuff that couldn’t run its post-upgrade or post-rm scripts and so couldn’t be upgraded or removed. Paying very close attention to what the script was doing I was able to remove a package the script used, rendering it a NOP (it was only doing something if the other package was installed).

Binary incompatibility

My biggest problem in general was that stupid Sleepycat morons made their %$#@! db’s binary format incompatible between 32 and 64 bit machines. Way to go guys—that’s thinking. This means that any packages you have that rely on libdb4.2 are screwed. For me this was Netatalk and the Cyrus IMAP server.

Netatalk

Netatalk turned out to be pretty easy. Just delete the .AppleDB files in the share directories. Netatalk uses them as caches and so it’s perfectly acceptable for them to go away (though if you have aliases that point into your share then they may break—I didn’t so I didn’t care).

Cyrus

Cyrus turned out to be pretty easy too, once I figured out what was happening. This post on the gentoo bugzilla explained how to recover, and it worked as advertised. Thanks to Rumi Szabolcs for posting that.

I installed Cyrus on a 32 bit linux machine I (luckily) had and converted the mailboxes file. Though it looks from the man page of cyrreconstruct (what it’s called in debian, by the way) that the -f command will reconstruct the mailboxes.db file from the directory layout, which might be handy if you don’t have a 32 bit Debian machine handy.

Last Modified on: Dec 31, 2014 18:59pm