Package: apt
Version: 1.0.9.8.3
Summary
--------
When purging a removed-but-not-purged package, apt is picking the candidate version instead --
and fails if the latter has a different architecture.
Details
--------
Due to iceweasel -> firefox-esr migration in stable, I removed iceweasel and installed firefox-esr
(which is faster than performing a dist-upgrade, removing transitional iceweasel packages and
marking firefox-esr as manually installed). Later I decided to purge iceweasel to get rid of now
obsolete /etc/iceweasel tree, but got this:
# apt-get purge iceweasel -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
iceweasel*
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 0 B of additional disk space will be used.
dpkg: warning: ignoring request to remove iceweasel which isn't installed
#
Here is how apt called dpkg:
/usr/bin/dpkg --status-fd 15 --force-depends --force-remove-essential --purge iceweasel:all
However:
# dpkg -s iceweasel | grep -E '^(Status|Version|Arch)'
Status: deinstall ok config-files
Architecture: i386
Version: 38.8.0esr-1~deb8u1
#
So it's iceweasel:i386 which should be purged, but apt picked iceweasel:all instead. This output
gives a clue, why:
# apt-cache policy iceweasel
iceweasel:
Installed: (none)
Candidate: 45.2.0esr-1~deb8u1
Version table:
45.2.0esr-1~deb8u1 0
500 http://security.debian.org/ jessie/updates/main i386 Packages
38.8.0esr-1~deb8u1 0
500 http://http.debian.net/debian/ jessie/main i386 Packages
500 http://security.debian.org/ jessie/updates/main i386 Packages
100 /var/lib/dpkg/status
# apt-cache show iceweasel | grep -E Version\|Arch
Version: 45.2.0esr-1~deb8u1
Architecture: all
Version: 38.8.0esr-1~deb8u1
Architecture: i386
#
So iceweasel:all is the candidate version.
Explicit specification of the correct architecture (i.e. `apt-get purge iceweasel:i386') doesn't work.
Reproduction
-------------
In order to simplify reproduction of this bug, I've created a fake bar package (attached) with
`Architecture: all', which installs /etc/fakebar conf-file. Also, there is a real bar package in the
archive with the same architecture as the host one.
Steps to reproduce:
1. Install the attached package.
2. Run `apt-get remove bar'.
3. Run `apt-get purge bar'.
The last one fails because instead of the fake bar apt tries to purge the real one, which has
a different architecture.
--
Алексей ШилинAttachment:
bar_1.0_all.deb
Description: Binary data