Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
2  
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. –  Faheem Mitha May 8 '13 at 16:46
    
appears to be a good guide –  Tshepang Mar 3 at 20:18

5 Answers 5

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.


WARNING: I HAVE NOT DONE THIS NOR EVEN ATTEMPTED IT!!!


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.

share|improve this answer

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
i386
# dpkg --add-architecture amd64
$ dpkg --print-foreign-architectures
amd64
# 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
amd64
$ dpkg --print-foreign-architectures
i386

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.

share|improve this answer
    
"What I would do instead"... man, I was sure that OP asked without reinstall :/ –  Braiam Sep 3 '13 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 Nov 23 '13 at 12:51
2  
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. –  Adrien Clerc Dec 21 '13 at 10:26

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:

http://blog.zugschlus.de/archives/972-How-to-amd64-an-i386-Debian-installation-with-multiarch.html

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.

share|improve this answer
    
Interesting to read what is actually involved, but having read this, I think I'm better off with a reinstallation. Thanks. –  Faheem Mitha Jun 26 '13 at 9:07

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.

share|improve this answer
    
--force-architecture is not needed, and the amd64 kernel can be installed via apt on i386. –  jordanm Aug 26 '12 at 20:59

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!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.