I was trying to crossgrade my architecture from i386 to amd64 (from https://wiki.debian.org/CrossGrading) and I got some error and broke apt-get and dpkg.

apt-get and dpkg output

cannot execute binary file: Exec format error

sudo apt-get outputs

/usr/bin/apt-get: 3: /usr/bin/apt-get: Syntax error: ")" unexpected

Here is the output from running some commands to give you the idea: http://paste.debian.net/949117/

uname -a outputs

Linux chowder 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2 (2017-04-30) i686 GNU/Linux

so I think I'm i686 which I think is 32 bit. Therefore I think the issue is that I'm on a 32 bit system running 64 bit apt-get and dpkg. This makes sense because I could have done the "Crossgrade dpkg, tar, and apt" part of that wiki without properly crossgrading my architecture - I could have missed an error. Eventually I want to be on an amd64 bit architecture to download chrome and all sorts of stuff, but first I'll need to fix my apt-get and dpkg, and maybe that end goal is just a pipe dream.

Should I just reinstall my os instead of crossgrading?

Should I downgrade apt-get and dpkg (change them from 64 bit to 32 bit)?

If so, where can I get an official copy of apt-get or dpkg - 32 bit? I wonder how I would have to install it once I got it too...

I was on the #debian IRC chat as nate_ (and nate__ at one point because I accidentally had two tabs open) talking about this issue, but had to leave before I got an answer. There "flying_commands" said "maybe you could manually extract the i686 debs from debian.org (on another machine?) to get the binaries back?" but I'm not quite sure how to do that, and how to install the debs without dpkg working.

Thank you to those at #debian, who helped extract a lot of this information so far. And thanks in advance to anyone who can help out.

  • Busybox will work, and it could have dpkg, if it's new enough.
    – muru
    May 29, 2017 at 1:21
  • 3
    Did you do step 2, “Install a kernel that supports both architectures in userland”? If you did, you need to reboot and make sure you pick the 64-bit kernel in the boot menu. May 29, 2017 at 4:58
  • I can reboot, and on the grub menu select advanced -> amd64, but when I do I get an error prompt after it boots saying I have to log out, and after clicking okay the screen goes black. May 29, 2017 at 16:38

2 Answers 2


I tried to crossgrade too, ended up with the same results as you. Reinstalling the system is the easiest and fastest way of troubleshooting your problem.


The uname -a output shows an "i686" architecture kernel, which is the 32-bit kernel. You cannot (sucessfully) upgrade userspace components without getting the 64-bit kernel installed and loading first. That requires: (1) installing the 64-bit kernel and (2) rebooting and (3) picking the new 64-bit kernel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .