I have a 32-bit system which runs on a 64-bit processor. How do I convert it to be all-64-bit, without re-installing? I have seen somewhere that it is doable as a result of the new Multiarch framework.

  • 6
    I'm interested in answers to this question. I've got a 32 bit system on a 64 bit capable machine (which is now 6+ years old, but still going for the moment). The only reason I used 32 bit when I originally installed this machine in 2007, was because I wanted to run 32 bit applications on it. With the new multiarch, if I understand correctly, 32 bit apps can easily be installed on a 64 bit machine. So, it would be nice to convert to 64 bit for wheezy, but I don't know how hard it would be. @bahamat's suggestion of using a VM sounds good. If I manage a successful conversion I'll answer here. Commented May 8, 2013 at 16:46
  • 1
    appears to be a good guide
    – tshepang
    Commented Mar 3, 2014 at 20:18
  • Similar question on AU: askubuntu.com/q/5018/178596
    – Wilf
    Commented Nov 23, 2015 at 22:05

8 Answers 8


TL;DR: It is doable, but complicated. I have outlined an alternative at the bottom.

Now the long description, and take it with a grain of salt, as I may not have taken the best route:

It is possible, and here is what I did for the last two nights: There is a wiki entry describing the old-school way without multiarch support. It is helpful for fixing broken packages.

To migrate your base system, do this:

$ dpkg --print-architecture
# dpkg --add-architecture amd64
$ dpkg --print-foreign-architectures
# apt-get update
# apt-get download gcc-4.6-base:amd64 libgcc1:amd64 libc6:amd64 \
          libselinux1:amd64 zlib1g:amd64 libbz2-1.0:amd64 dpkg:amd64
# dpkg -i gcc-4.6-base*.deb libgcc*.deb libc*.deb libselinux*.deb \
          libbz2*.deb zlib*.deb dpkg*.deb
$ dpkg --print-architecture
$ dpkg --print-foreign-architectures

Some of your packages are then amd64, but most will remain i386. apt-get upgrade will take care of some packages, apt-get -f install will repair some of errors, but still most packages will remain i386. If you want to cope with this, then skip the tricky part ;)

Using dpkg --get-selections | grep :i386 will return all your packages, that you will still have to migrate.

My next idea was to do:

# apt-get install `dpkg --get-selections \
  | grep i386 \
  | awk {'gsub(/:i386/, ":amd64"); print $1'}`

But it turned out to be a bad idea: some packages are not available in amd64 (e.g. libc6-i686), apt-get will be confused, and a lot of packages will be installed in both versions. A lot of manual work in aptitude is to be done.

More hardship: Some essential packages can be replaced, so that you will always have the binaries installed for installation, but some packages will have to be removed and installed again, e.g. I had this problem with tar. I wgot the packages on another system, extracted the packages via ar p package.deb data.tar.gz | tar zx and then scped the extracted files via scp -r ./* root@other_computer:/, so the binaries are available again. Rinse and repeat, and the scped files will be overwritten.

What I would do instead

I have done the following, whenever I switched systems:

Back up /home, /etc (and maybe /var, /usr/local, some other files you have changed, /root, ..., YMMV).

Get a list of installed packages with dpkg --get-selections > packagelist and copy the resulting file packagelist as well.

Then do a clean reinstall of Debian, create all users again, maybe roles, etc.

Reinstall all packages with dpkg --set-selections < packagelist; apt-get -f install.

Copy back the backed up directories, files, and you are mostly done.

One downside to that approach: All your packages, including libraries, will be marked as manually installed, so they will not be uninstalled, when no package depends on them any more.

  • 2
    "What I would do instead"... man, I was sure that OP asked without reinstall :/
    – Braiam
    Commented Sep 3, 2013 at 18:28
  • @Braiam The OP most likely wanted to do that without a reinstall. I was just reporting my personal experience doing that. The alternative route is simpler to me, and maybe I have made some mistakes while converting the system.
    – Residuum
    Commented Nov 23, 2013 at 12:51
  • 8
    To mark automatically installed packages, you could have used apt-mark showauto to export the auto-installed list and apt-mark auto to mark them in the new installation. Commented Dec 21, 2013 at 10:26
  • Thanks for writing up your experience. "If you want to cope with this, then skip the tricky part ;)" What if my goal is just to be able to develop software for x86_64, and don't care if my system packages aren't using the 64-bit processor optimally? I'm also running a 32-bit OS. I guess I thought my processor was 32-bit when I first did the install :(
    – jberryman
    Commented Jun 4, 2015 at 21:29

The other answers here show that while this is theoretically possible, it is very complex and probably not worth the effort. You can, however, do a clean install and make the process relatively painless if you keep your $HOME the same.

The general process will be

  1. Make a backup of your list of installed packages and the list of automatically-installed packages.

    dpkg --get-selections '*' > package.list
    apt-mark showauto >auto.list

    Note that you might also want to remove the architecture from any package names that you have installed using multiarch:

    dpkg --get-selections '*' | sed -e 's/:\(i386\|amd64\)//' > package.list
  2. If your /home is a separate partition, just make sure not to format it during the installation process. If it is not on a separate partition, make a backup that you can restore from later:

    tar cvzf home_backup.tgz $HOME/
  3. Once you have installed your new system, install the missing packages

    sudo dpkg --set-selections < package.list 
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo apt-mark auto $(cat auto.list)
  4. Restore your $HOME. Copy the tgz file over and extract it in your $HOME directory:

    tar xvzf home_backup.tgz

You might also want to have a look at the tools that Mint provides to make this easier. They should all be installable on Ubuntu as well.


It is in theory possible, but likely treacherous. Debian multiarch at current supports multiarch libs, but not binaries. So there's that.

The system primarily understands its own architecture from dpkg-architecture (which is actually a perl script, but it extracts the arch info and displays it), which also claims to be able to set the architecture.


The rough process would be:

  1. Install the multiarch variant of all of your libraries (most importantly libgcc1)
  2. Use dpkg-architecture -aamd64 to shift your arch (Note, it may complain about GCC)
  3. Download and stage all required components (see next)
  4. Force installing the amd64 variant of dpkg and dependencies
  5. Force installing amd64 variants of essential base system packages, including apt-get and the kernel (Note, it may complain A LOT)
  6. Reboot
  7. Presumably install the rest of the system with apt-get

These steps are based on what I know of the design of Debian having used it almost exclusively among Linux distros over the past 12 years (including having used debtakeover before) and the approach that I would take. So consider this at your own risk. Your system may become unusable any time after attempting step 4. Alternate for steps 4 & 5 might be debbootstrap.

Most importantly, I highly suggest trying this on a VM before doing it on anything you care about.

Good luck, and May the Force be With You.


There are quite a few manuals out there, but hardly any show what to really expect. I am writing this on a Debian Wheezy laptop that I just finished upgrading from 32 bit to 64 and it does indeed work.

I followed these instructions and they were really accurate on what you will actually face:


A recommendation is to keep the system powered through the whole process, do not reboot unless you are sure that you have migrated everything and that everything that was removed was installed again (especially essential packages), or you will not get the system running again.

  • 1
    Interesting to read what is actually involved, but having read this, I think I'm better off with a reinstallation. Thanks. Commented Jun 26, 2013 at 9:07
  • That link isn't working for me - has the resource moved? Commented May 14, 2019 at 8:05
  • Oh yeah, did you see the date? I wrote that in 2013, stuff often vanishes on the web in 6 years. Sadly, the web still does not have a very basic function: Showing broken links before you click on a link. Commented May 15, 2019 at 23:33
  • In this end, this is a pretty crazy stunt. I tried this back then "just to see if I would pull it off" (TM) Reinstalling is more elegant and justified, considering this is a big architectural change in the OS install. Commented Apr 13, 2020 at 12:39

Not an answer to the question, but it may be difficult to upgrade all packages from x86 to amd64, but you can at least easily install the amd64 kernel package, which will at least allow you to run 64 bit applications and virtual machines and containers (which may be enough for what you need).

Just install the amd64 linux-image package with dpkg -i --force-architecture.

  • 1
    --force-architecture is not needed, and the amd64 kernel can be installed via apt on i386.
    – jordanm
    Commented Aug 26, 2012 at 20:59

Following the idea using awk, I ended up using:

dpkg --get-selections \               # get the list
 | grep -v deinstall \                # throw away deselected packages
 | grep ':i386' \                     # get the i386 arch packages
 | sed 's/install//g' \               # drop 'install' to get list
 | sed 's/:i386/:amd64/g' \           # replace i386 with amd64
 | while read package; do \           # iterate over the result
      apt-get -yf install $package; \ # install each one and fix dependencies

I had to run it a few times. dpkg --get-selections is simply an alphabetical list, so packages at the top that require packages at the bottom will be passed over. If you want to watch how many are being installed, do dpkg --get-selections | grep amd64 | wc -l inside the while loop.


There is automated tool capable of doing this: https://github.com/pbkwee/distrorejuve


I have little experience with the matter, but I do believe that you are correct when you say converting from 32 to 64 should be capable with the multi-arch. I would be cautious though about how well supported this new system is.

Here is one of the documents that I read that discussed the matter, perhaps this will help you: https://wiki.ubuntu.com/MultiarchSpec

Notice the third User Stories. Here is another link around the same topic: https://help.ubuntu.com/community/MultiArch

Even though it might be a tad different between Debian and Ubunutu, this is a core feature. Which I would imagine Ubuntu and Debian would work closely to get this structure functioning on the ground before Ubuntu would pull away and do something of their own liking.

Good luck!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .