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.
Asked
Active
Viewed 9.5k times
100
Journeyman Geek
- 129,178
kevinarpe
- 3,828
3 Answers
151
I am answering my own question after gathering important information from other blog posts.
- Show what foreign architectures are installed:
dpkg --print-foreign-architectures- Might show:
i386
- Might show:
- Review
i386packages on your system:dpkg -l | grep i386 - Remove all
i386packages:apt-get purge ".*:i386"- Note: The
purgekeyword (instead ofremove) removes all configuration files associated with the packages you're uninstalling. (Thanks PCGuyIV!)
- Note: The
- Now you can remove the
i386architecture:dpkg --remove-architecture i386
35
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.
-
2Can you expand your answer to explain the difference and ramifications? – fixer1234 Jul 12 '15 at 23:07
12
$ sudo apt remove `dpkg --get-selections |grep :i386 |awk '{print $1}'`
$ sudo dpkg --remove-architecture i386
Serge Stroobandt
- 2,145
-
2
-
1I would suggest that you change the grep to grep ':i386 '. this is because some other packages have i386 in the description text. @WGRM – ElderDelp Jan 28 '23 at 03:31
apt remove `dpkg --get-selections |grep :i386 |awk '{print $1}'` --allow-remove-essential -fand after thatdpkg --remove-architecture i386– alireza Oct 09 '23 at 04:41