Debian: simple conversion of i386 to amd64

This is a short article on how to set up a 64-bit architecture on your 32-bit Debian/Deabian-based distribution (which you may have inadvertently downloaded instead of 64bit) without reinstalling.

* Your hardware must initially support amd64, no one is going to do magic.
* This may damage the system, so be very careful.
* All tested against Debian10-buster-i386.
* Do not do this if you do not understand at least something here.

dpkg, apt and sources.list

Straight to the point, if you’ve weighed everything crazy, we start preparing packages (in principle, the order here does not matter, but it’s more convenient point by point)

1. Select amd64 in /etc/apt/sources.list by inserting ' [arch=amd64] ' between debdeb-src and URL

Example

# Base reps
deb [arch=amd64] http://deb.debian.org/debian/ buster main contrib non-free
deb-src [arch=amd64] http://deb.debian.org/debian/ buster main contrib non-free

# Update reps
deb [arch=amd64] http://deb.debian.org/debian/ buster-updates main
deb-src [arch=amd64]  http://deb.debian.org/debian/ buster-updates main

# Security reps
deb [arch=amd64] http://security.debian.org/debian-security/ buster/updates main
deb-src [arch=amd64] http://security.debian.org/debian-security/ buster/updates main

This is necessary so that only 64-bit packages are loaded in the future.

2. Add amd64 to dpkg so that it does not swear:

$ sudo dpkg --add-architecture amd64

3. Update the list of packages:

$ sudo apt update

Core

Of course, all this does not make sense without a 64-bit kernel, so install it:

$ sudo apt install linux-headers-$VERSION-amd64 linux-image-amd64

Place $VERSION to substitute the desired kernel version.

After installing the kernel, grub will be reconfigured automatically.

Completion

After the reboot, our system will already be able to work with amd64, but there may be some problems with the packages. To solve them, it was enough for me to execute these commands:

$ sudo apt --fix-broken install
$ sudo apt full-upgrade

Although you shouldn’t worry too much about this either - all the necessary packages will eventually be installed as dependencies themselves, and the unnecessary ones are removed like this:

$ sudo apt autoremove

Now you have a 64-bit system at your disposal!

Source: habr.com

Add a comment