107

I added foreign architecture i386 to my Debian amd64 installation. How do I remove it? When I try this command: dpkg --remove-architecture i386, I am told to first remove all i386 packages.

Journeyman Geek
  • 133,878
kevinarpe
  • 4,048

4 Answers4

159

I am answering my own question after gathering important information from other blog posts.

  1. Show what foreign architectures are installed: dpkg --print-foreign-architectures
    • Might show: i386
  2. Review i386 packages on your system: dpkg -l | grep i386
  3. Remove all i386 packages: apt-get purge ".*:i386"
    • Note: The purge keyword (instead of remove) removes all configuration files associated with the packages you're uninstalling. (Thanks PCGuyIV!)
  4. Now you can remove the i386 architecture: dpkg --remove-architecture i386
Daniel
  • 278
kevinarpe
  • 4,048
37

I would use "purge" instead of "remove".

~# apt-get purge ".*:i386"
~# dpkg --remove-architecture i386

The "purge" keyword removes all configuration files associated with the packages you're uninstalling.

nc4pk
  • 9,257
  • 14
  • 61
  • 71
PCGuyIV
  • 471
15
$ sudo apt remove `dpkg --get-selections |grep :i386 |awk '{print $1}'`
$ sudo dpkg --remove-architecture i386
0
  1. List the package list:

    sudo dpkg --list | grep :i386

  2. remove :i386 packages one by one:

    sudo dpkg --purge --force-all package-name

  3. As for an example:

    sudo dpkg --purge --force-all libc6:i386

  4. Then remove the architecture:

    sudo dpkg --remove-architecture i386

  5. run update and upgrade:

    sudo apt update && sudo apt upgrade -y