101

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.

3 Answers 3

151

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
3
  • 1
    Rejected edit from superuser.com/users/944626/benjamin-buch, but still a good comment: "You might need apt-get purge --allow-remove-essential ".*:i386" to remove libc and other essential packages. Be very careful with --allow-remove-essential because it will kill your system if you accidentally remove the 64 bit version instead of the 32 bit one!"
    – kevinarpe
    Commented Dec 23, 2022 at 5:08
  • 3
    complete command is like this : apt remove `dpkg --get-selections |grep :i386 |awk '{print $1}'` --allow-remove-essential -f and after that dpkg --remove-architecture i386
    – alireza
    Commented Oct 9, 2023 at 4:41
  • Is this "safe"? I'm trying to understand why i386 packages are installed ... if running in float32 mode for some frameworks I wonder if hte i386 are ever used. It's not clear to me.
    – safetyduck
    Commented Jan 12 at 11:51
36

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.

1
  • 2
    Can you expand your answer to explain the difference and ramifications?
    – fixer1234
    Commented Jul 12, 2015 at 23:07
12
$ sudo apt remove `dpkg --get-selections |grep :i386 |awk '{print $1}'`
$ sudo dpkg --remove-architecture i386
2
  • 2
    ONLY USE THIS ANSWER OR YOU WILL LOOSE LOTS OF PACKAGES!
    – WGRM
    Commented Sep 9, 2021 at 23:13
  • 2
    I would suggest that you change the grep to grep ':i386 '. this is because some other packages have i386 in the description text. @WGRM
    – ElderDelp
    Commented Jan 28, 2023 at 3:31

You must log in to answer this question.

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