How do I remove all i386 architecture packages from my Debian installation?

43

13

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

kevinarpe

Posted 2014-02-09T12:01:22.453

Reputation: 2 133

Answers

53

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. 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!)
  3. Now you can remove the i386 architecture: dpkg --remove-architecture i386

kevinarpe

Posted 2014-02-09T12:01:22.453

Reputation: 2 133

2Cheers. This was perfect. – Glenn – 2014-10-01T22:44:31.287

@kevinarpe You might accept this answer as the best answer. – 71GA – 2018-09-12T07:39:01.623

24

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.

PCGuyIV

Posted 2014-02-09T12:01:22.453

Reputation: 341

2Can you expand your answer to explain the difference and ramifications? – fixer1234 – 2015-07-12T23:07:22.403

3

$ sudo apt remove `dpkg --get-selections |grep i386 |awk '{print $1}'`
$ sudo dpkg --remove-architecture i386

Serge Stroobandt

Posted 2014-02-09T12:01:22.453

Reputation: 1 152

-1

Try

dpkg -r $(dpkg -l | grep armhf | awk '{ print $2 }')

Andrew

Posted 2014-02-09T12:01:22.453

Reputation: 1

That's obviously for the armhf architecture - use i386 in your case. – Andrew – 2019-02-09T01:18:36.447

So what is the actual solution? – fixer1234 – 2019-02-09T04:03:10.510