32 to 64 bit distro crossgrades for Debian and Ubuntu


The demise of 32 bit distros is nigh!

Some distros are dropping or reducing support for 32 bit versions.  e.g. only providing 64 bit ISO downloads.

Some software makers are no longer putting out 32 bit versions of their software.  e.g. Since version 9 Oracle have only released a 64 bit version of Java.

In most cases you will be fine to remain on 32 bit distros until you need some software application that is 64 bit only (e.g. Java 9 or Java 10).  If you have a lot of memory and are not limited by the 32 bit application 4GB per process limit then running a 64 bit kernel on a 32 bit distro can be a good option.

One way to escape your old or 32 bit distro is to setup a newer server and migrate to that (or reinstall your current one).  However for some customers this can be difficult.  Migrating databases.  Bringing across custom configs and cron jobs and bespoke setups.  Changing IPs.

If you do not have the luxury of a reinstall then you may want to consider a cross grade.  Where you convert a 32 bit distro to a 64 bit one.

We have been adding 32 to 64 bit cross grade support to our distrorejuve tool.  At the moment the script is in alpha.  We recommend you make a full server snapshot prior to starting the process.

You can run the distrorejuve 32 to 64 bit crossgrade as:

wget -O distrorejuve.sh --no-check-certificate https://raw.githubusercontent.com/pbkwee/distrorejuve/master/distrorejuve.sh

sudo bash distrorejuve.sh --to-64bit | tee -a distrorejuve.log

The process it follows goes like this:

  • Check the server is running a 64 bit kernel (it is fine to have a 64 bit kernel on a 32 bit distro)
  • Checks the server is running either Debian or Ubuntu (other distros not supported yet).
  • Checks you do not have old packages (packages installed from sources no longer in your current package repositories).  e.g. After some distro upgrades you may be left with php5 packages from the earlier distro as well as the php7 packages that come with your newer distro.
  • Enable 64 bit package versions in your repository (dpkg –add-architecture amd64)
  • apt-get download some key packages like dpkg:amd64 tar:amd64 apt:amd64 apt-utils:amd64 and perl-base:amd64
  • Use dpkg –install to install those.
  • Temporarily you will now have some packages with both 32 and 64 bit versions.
  • At this point your apt setup is sometimes broken and apt-get -f install may be unable to resolve the dependencies.  In this case distrorejuve apt-get downloads the essential packages that were reporting as missing and then also install those with dpkg.
  • distrorejuve then finds all the 32 bit applications currently installed on your server that self-report with apt-cache show as ‘Essential: Yes’  and uses apt-get download to download the 64 bit versions of those and installs them.
  • distrorejuve then iterates over all the 32 bit application packages on your server and apt-get installs the 64 bit version and apt-get removes the 32 bit version.
  • For good measure we record what packages were installed prior to the start of the cross grade run.  Subsequent distrorejuve.sh –to-64bit calls will look at that original list and attempt to install the original package lists.
  • For good measure the crossgrade script will list any remaining 32 bit applications and libraries that remain on your server at the end of the process and provides a –remove-cruft option to get rid of those.

distrorejuve also works around a few odd errors that can crop up:

  • “trying to overwrite shared ‘/etc/python2.7/sitecustomize.py’, which is different from other instances of package libpython2.7-minimal:amd64” and “trying to overwrite shared ‘/usr/share/doc/libkmod2/changelog.Debian.gz’, which is different from other instances of package libkmod2:amd64”
  • systemd : Depends: libcap2-bin when removing gcc-6-base:i386
  • pre-dependency problem – not installing bash
  • dpkg –install reporting: Errors were encountered while processing

Different setups may result in different errors.  Our goal with distrorejuve is to try to find as many of the common issues as we can and automate the resolution.  So the script can be as hands-off and unattended as possible.  Ideally you would start the distrorejuve process, head out for a long coffee break and come back to a job well done.  Feedback via our support channels or github is welcomed.

Not sure if you are running a 32 bit or 64 bit distro?  Just run

getconf LONG_BIT

FYI: uname -a will report the current kernel.  But a 64 bit kernel does not mean you are running a 32 bit distro,


4 responses to “32 to 64 bit distro crossgrades for Debian and Ubuntu”

  1. […] As with other newer images, there is only a 64 bit image for new setups or re-installs. Most customers are now ordering 64 bit distros.  And some distros only come in a 64 bit flavor now. Customers with an existing 32bit install also have the option to crossgrade to a 64bit install in place. […]

    • Heya. You can use your own images using the API if you want. WHat exactly did you need that requires knoppix ?