Hi, On Wed, 14 Mar 2012, Sven Joachim wrote: > Here is a patch adding two missing newlines on output: Thanks. > Note that libc-bin:amd64 is actually purged, however it remains in the > status file (note that the "Multi-Arch: foreign" field is missing): Ok, fixed that as well by ignoring "not-installed" entries when considering multiple instances. And I kept the advice to dpkg -P only when it was in config-files state. Otherwise I leave it up to the user's judgment. Updated version attached."); } sub find_installed { return ($_[0] !~ / not-installed$/); } # Detect multiple instances which are not M-A: same foreach my $foreign ($status->get("Architecture" => \&find_foreign)) { my $pkg = $foreign->{'Package'}; my $pkgarch = $foreign->{'Package'} . ':' . $foreign->{'Architecture'}; my $ma = $foreign->{'Multi-Arch'} || 'no'; print "INFO: Foreign package detected: $pkgarch (Multi-Arch: $ma)\n"; my @pkgs = $status->get("Package" => $pkg, "Status" => \&find_installed); if (scalar(@pkgs) > 1) { foreach my $item (@pkgs) { $pkgarch = $item->{'Package'} . ':' . $item->{'Architecture'}; if ($item->{'Multi-Arch'} ne "same") { print "PROBLEM: one instance of $pkg is not Multi-Arch: same\n"; if ($item->{'Status'} =~ / config-files$/) { print "SOLUTION: dpkg -P $pkgarch\n"; } else { print "SOLUTION: update $pkgarch to a good version or get rid of it\n"; } } } } } #"; } }