This is a brief article on how to set up a 64-bit architecture on your 32-bit Debian/ Debian-based distribution (which you may have inadvertently downloaded instead of the 64-bit version) without reinstalling.
* Your hardware must initially support amd64; no magic will be performed.
* This can damage your system, so proceed very carefully.
* Everything has been tested on Debian10-buster-i386.
* Do not attempt this if you do not understand anything here.
Dpkg, apt, and sources.list
Straight to the point, if you have thoroughly considered everything, let's start preparing the packages (the order here doesn't matter much, but itemizing is more convenient)
1. Choose amd64 in /etc/apt/sources.list by inserting ‘ [arch=amd64] ‘ between deb and deb-src URLs.
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 mainThis is necessary so that only 64-bit packages are downloaded in the future.
2. Add amd64 to dpkg so it won't complain:
$ sudo dpkg --add-architecture amd643. Update the package list:
$ sudo apt updateKernel
Of course, all this is pointless without a 64-bit kernel, so let's install it:
$ sudo apt install linux-headers-$VERSION-amd64 linux-image-amd64Replace $VERSION with the appropriate kernel version.
After installing the kernel, grub will automatically reconfigure.
Completion
After rebooting, our system will be able to handle amd64, but there may be some issues with packages. To resolve them, I just needed to run the following commands:
$ sudo apt --fix-broken install
$ sudo apt full-upgradeAlthough you shouldn't worry too much about it — all necessary packages will eventually install themselves as dependencies, and unnecessary ones can be removed like this:
$ sudo apt autoremove Now you have a 64-bit system at your disposal!
Source: habr.com
