Cross-grading a Debian System

This page is meant to document the procedure for cross-grading a Debian install using Multiarch.

Please note this is still work in progress and re-installing is still safer.

Pre-requisites

The first Debian release to feature Multiarch is Wheezy, so you will need to upgrade before attempting the procedure described here.

Steps

These are the steps for converting an i386 install to amd64, but they should be applicable for any other architecture pairs if your machine can run both (e.g. armel and armhf).

Add the new architecture

# dpkg --print-architecture
i386
# dpkg --add-architecture amd64
# dpkg --print-foreign-architectures
amd64
# apt-get update

Install a kernel capable to run the new architecture with the old architecture in userspace

# apt-get install linux-image-amd64:amd64
# reboot

Make sure you are actually running the new kernel before proceeding with the next steps (uname -a).

Crossgrade `dpkg` and `apt`

# apt-get --download-only install dpkg:amd64 apt:amd64
# dpkg --install /var/cache/apt/archives/*_amd64.deb
# dpkg --print-architecture
amd64
# dpkg --print-foreign-architectures
i386

If you got this far you are now effectively running amd64, but with mostly i386 packages. You can try to replace them with the corresponding amd64 packages. If that doesn't work (it is expected that not all libraries will be converted to Multiarch in Wheezy) it should be possible to remove the i386 package and install the amd64 version instead.