Purging i386 packages from an amd64 (64-bit) System & reinstall all packages

Generate list of all installed packages

dpkg --get-selections > installed.txt

Deinstall all i386 packages

grep ':i386' < installed.txt.old |cut -d: -f1 | cut -f1 | xargs -n1 apt-get remove

Remove i386 architecture from DPKG Database

dpkg --remove-architecture i386

Download all needed packages and check for install candidates

apt-get -f -o Dpkg::Options::="--force-overwrite" install --reinstall $(cut -f1 < installed.txt |grep -v ':i386')

Reinstall all but i386 packages

grep -v ':i386' < installed.txt.old | cut -d: -f1 | cut -f1 | xargs -n1 apt-get -f -o Dpkg::Options::="--force-overwrite" install --reinstall

Alternatively you can reinstall all packages if no i386 packages are installed. This is good for those that are just wanting to get the box back in shape after disaster has struck.

cut -d: -f1 < installed.txt | cut -f1 | xargs -n1 apt-get -f -o Dpkg::Options::="--force-overwrite" install --reinstall
/var/customers/webs/cw01/wiki/data/pages/debian/clean-i386-packages-from-amd64-system.txt · Last modified: 2014/08/20 11:37 by wadmin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki