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.
Debian – How to convert a 32-bit (x86) Debian-based system to 64-bit
32bit64bitdebian
Best 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:
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:
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 thenscp
ed the extracted files viascp -r ./* root@other_computer:/
, so the binaries are available again. Rinse and repeat, and thescp
ed 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 filepackagelist
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.