Bug#806422: apt: no longer handles mutually-exclusive sets of essential packages well
Package: apt
Version: 1.1
Severity: normal
I just got upgraded…
| Unpacking apt (1.1) over (1.0.10.2) ...
… and now, a dist-upgrade has a regression.
Background story: I created a package dash-mksh that contains
a (versioned, due to the versioned dependency of bash on dash)
Provides for dash, and replaces it completely. This worked in
jessie and sid up to today: the package one has installed had
precedence, a dist-upgrade never wanted to switch between both
(which is good, as not everyone who uses my APT repo wishes to
replace their dash package, and everyone who d̲i̲d̲ replace it in
no event wishes to have it automatically switched back). This
is no longer the case. apt-cache show output added for debugging.
(sid-amd64)root@tglase:~ # apt-get --purge dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) dash-mksh [ amd64 ] < 6 > ( shells )
Broken dash-mksh:amd64 Conflicts on dash [ amd64 ] < none -> 0.5.7-4+b1 > ( shells )
Considering dash:amd64 5207 as a solution to dash-mksh:amd64 5203
Removing dash-mksh:amd64 rather than change dash:amd64
Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libapt-inst1.7 libapt-pkg4.16
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
dash-mksh*
The following NEW packages will be installed:
dash
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
dash-mksh
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 109 kB of archives.
After this operation, 148 kB of additional disk space will be used.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] nooooo!
Abort.
(sid-amd64)1|root@tglase:~ # apt-cache show dash dash-mksh
Package: dash
Source: dash (0.5.7-4)
Version: 0.5.7-4+b1
Essential: yes
Installed-Size: 191
Maintainer: Gerrit Pape <pape@smarden.org>
Architecture: amd64
Depends: debianutils (>= 2.15), dpkg (>= 1.15.0)
Pre-Depends: libc6 (>= 2.14)
Description-en: POSIX-compliant shell
The Debian Almquist Shell (dash) is a POSIX-compliant shell derived
from ash.
.
Since it executes scripts faster than bash, and has fewer library
dependencies (making it more robust against software or hardware
failures), it is used as the default system shell on Debian systems.
Description-md5: 8d4d9c32c6b2b70328f7f774a0cc1248
Homepage: http://gondor.apana.org.au/~herbert/dash/
Tag: implemented-in::c, interface::shell, role::program, scope::utility
Section: shells
Priority: required
Filename: pool/main/d/dash/dash_0.5.7-4+b1_amd64.deb
Size: 109056
MD5sum: 56256be477fea8bb2ac5985ec478beaf
SHA1: b92cd198e563e2c80a7e4d3cb15f52628eecbb47
SHA256: c55031a57ada3fac236f1936eb111e985bea235b86f9767929fec1e552a81aca
Package: dash-mksh
Version: 6
Architecture: all
Essential: yes
Origin: WTF
Bugs: mailto:wtf@mirbsd.org
Maintainer: Thorsten Glaser <tg@mirbsd.de>
Installed-Size: 46
Pre-Depends: mksh (>= 50b)
Conflicts: dash
Breaks: bash (<< 4.3-9.2)
Replaces: dash
Provides: dash (= 2147483647:1)
Filename: dists/sid/wtf/Pkgs/dash-mksh/dash-mksh_6_all.deb
Size: 3238
MD5sum: 65fe404dc0a421db609941b26accfdf8
SHA1: 84305d59bc5a4dfd865bda5e268881b32d1e8942
SHA256: 20f6087837f56cdf07f9154c65c2b508e6fd00bd5d498f95fe5d85645becbaa3
Section: shells
Priority: extra
Multi-Arch: foreign
Homepage: https://www.mirbsd.org/mksh.htm
Description: fake dash using mksh
This package installs enough to replace the “dash” package
from a Debian system, implementing a fake “dash” command by
using mksh’s “lksh” executable, which is also normally used
as /bin/sh on decent systems.
.
Before installing this package, you may have to run “sudo
dpkg-reconfigure -plow dash” and say “no” to using dash as
/bin/sh because otherwise, the dash package fails to remove.
.
This package Provides, Conflicts, and Replaces dash, which
will be removed, with a warning. It does not, however, take
up the /bin/sh diversion, which means that the system shell
will end up being GNU bash by default. It is strongly urged
to run the following commands after installation:
.
sudo dpkg-divert --package bash --rename --remove /bin/sh;
sudo dpkg-divert --local --divert /bin/sh.distrib --add /bin/sh;
sudo ln -sf lksh /bin/sh;
sudo dpkg-divert --package bash --rename --remove /usr/share/man/man1/sh.1.gz;
sudo dpkg-divert --local --divert /usr/share/man/man1/sh.distrib.1.gz /usr/share/man/man1/sh.1.gz;
sudo ln -sf lksh.1.gz /usr/share/man/man1/sh.1.gz
.
Of course, you can also just set the symlink, but upgrade or
reinstallation of the “bash” package will trash them.
Description-md5: 19266921a9bb7fa00ccdbb2fb5eae110
(sid-amd64)root@tglase:~ #
-- Package-specific info:
-- apt-config dump --
APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "0";
APT::Install-Suggests "0";
APT::Sandbox "";
APT::Sandbox::User "_apt";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-image-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-headers-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-headers-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-image-extra-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-image-extra-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-signed-image-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-signed-image-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-image-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-image-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-headers-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-headers-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^gnumach-image-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^gnumach-image-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^.*-modules-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^.*-modules-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^.*-kernel-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^.*-kernel-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-4\.2\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-tools-4\.1\.0-1-amd64$";
APT::NeverAutoRemove:: "^linux-tools-4\.2\.0-1-amd64$";
APT::VersionedKernelPackages "";
APT::VersionedKernelPackages:: "linux-image";
APT::VersionedKernelPackages:: "linux-headers";
APT::VersionedKernelPackages:: "linux-image-extra";
APT::VersionedKernelPackages:: "linux-signed-image";
APT::VersionedKernelPackages:: "kfreebsd-image";
APT::VersionedKernelPackages:: "kfreebsd-headers";
APT::VersionedKernelPackages:: "gnumach-image";
APT::VersionedKernelPackages:: ".*-modules";
APT::VersionedKernelPackages:: ".*-kernel";
APT::VersionedKernelPackages:: "linux-backports-modules-.*";
APT::VersionedKernelPackages:: "linux-tools";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "contrib/metapackages";
APT::Never-MarkAuto-Sections:: "non-free/metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Move-Autobit-Sections "";
APT::Move-Autobit-Sections:: "oldlibs";
APT::Move-Autobit-Sections:: "contrib/oldlibs";
APT::Move-Autobit-Sections:: "non-free/oldlibs";
APT::Move-Autobit-Sections:: "restricted/oldlibs";
APT::Move-Autobit-Sections:: "universe/oldlibs";
APT::Move-Autobit-Sections:: "multiverse/oldlibs";
APT::Architectures "";
APT::Architectures:: "amd64";
APT::Compressor "";
APT::Compressor::. "";
APT::Compressor::.::Name ".";
APT::Compressor::.::Extension "";
APT::Compressor::.::Binary "";
APT::Compressor::.::Cost "1";
APT::Compressor::gzip "";
APT::Compressor::gzip::Name "gzip";
APT::Compressor::gzip::Extension ".gz";
APT::Compressor::gzip::Binary "gzip";
APT::Compressor::gzip::Cost "2";
APT::Compressor::gzip::CompressArg "";
APT::Compressor::gzip::CompressArg:: "-9n";
APT::Compressor::gzip::UncompressArg "";
APT::Compressor::gzip::UncompressArg:: "-d";
APT::Compressor::xz "";
APT::Compressor::xz::Name "xz";
APT::Compressor::xz::Extension ".xz";
APT::Compressor::xz::Binary "xz";
APT::Compressor::xz::Cost "3";
APT::Compressor::xz::CompressArg "";
APT::Compressor::xz::CompressArg:: "-6";
APT::Compressor::xz::UncompressArg "";
APT::Compressor::xz::UncompressArg:: "-d";
APT::Compressor::bzip2 "";
APT::Compressor::bzip2::Name "bzip2";
APT::Compressor::bzip2::Extension ".bz2";
APT::Compressor::bzip2::Binary "bzip2";
APT::Compressor::bzip2::Cost "4";
APT::Compressor::bzip2::CompressArg "";
APT::Compressor::bzip2::CompressArg:: "-9";
APT::Compressor::bzip2::UncompressArg "";
APT::Compressor::bzip2::UncompressArg:: "-d";
APT::Compressor::lzma "";
APT::Compressor::lzma::Name "lzma";
APT::Compressor::lzma::Extension ".lzma";
APT::Compressor::lzma::Binary "xz";
APT::Compressor::lzma::Cost "5";
APT::Compressor::lzma::CompressArg "";
APT::Compressor::lzma::CompressArg:: "--format=lzma";
APT::Compressor::lzma::CompressArg:: "-9";
APT::Compressor::lzma::UncompressArg "";
APT::Compressor::lzma::UncompressArg:: "--format=lzma";
APT::Compressor::lzma::UncompressArg:: "-d";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::solvers "";
Dir::Bin::solvers:: "/usr/lib/apt/solvers";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Bin::bzip2 "/bin/bzip2";
Dir::Bin::xz "/usr/bin/xz";
Dir::Bin::lzma "/usr/bin/xz";
Dir::Media "";
Dir::Media::MountPath "/media/apt";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Acquire "";
Acquire::AllowInsecureRepositories "1";
Acquire::AllowDowngradeToInsecureRepositories "0";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom/";
Acquire::IndexTargets "";
Acquire::IndexTargets::deb "";
Acquire::IndexTargets::deb::Packages "";
Acquire::IndexTargets::deb::Packages::MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
Acquire::IndexTargets::deb::Packages::flatMetaKey "Packages";
Acquire::IndexTargets::deb::Packages::ShortDescription "Packages";
Acquire::IndexTargets::deb::Packages::Description "$(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
Acquire::IndexTargets::deb::Packages::flatDescription "$(RELEASE) Packages";
Acquire::IndexTargets::deb::Packages::Optional "0";
Acquire::IndexTargets::deb::Translations "";
Acquire::IndexTargets::deb::Translations::MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatMetaKey "$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::ShortDescription "Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::Description "$(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatDescription "$(RELEASE) Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb-src "";
Acquire::IndexTargets::deb-src::Sources "";
Acquire::IndexTargets::deb-src::Sources::MetaKey "$(COMPONENT)/source/Sources";
Acquire::IndexTargets::deb-src::Sources::flatMetaKey "Sources";
Acquire::IndexTargets::deb-src::Sources::ShortDescription "Sources";
Acquire::IndexTargets::deb-src::Sources::Description "$(RELEASE)/$(COMPONENT) Sources";
Acquire::IndexTargets::deb-src::Sources::flatDescription "$(RELEASE) Sources";
Acquire::IndexTargets::deb-src::Sources::Optional "0";
Acquire::Changelogs "";
Acquire::Changelogs::URI "";
Acquire::Changelogs::URI::Origin "";
Acquire::Changelogs::URI::Origin::Debian "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog";
Acquire::Changelogs::URI::Origin::Tanglu "http://metadata.tanglu.org/changelogs/CHANGEPATH_changelog";
Acquire::Changelogs::URI::Origin::Ubuntu "http://changelogs.ubuntu.com/changelogs/pool/CHANGEPATH/changelog";
Acquire::Changelogs::URI::Origin::Ultimedia "http://packages.ultimediaos.com/changelogs/pool/CHANGEPATH/changelog.txt";
Acquire::CompressionTypes "";
Acquire::CompressionTypes::Order "";
Acquire::CompressionTypes::Order:: "gz";
Acquire::Languages "";
Acquire::Languages:: "en";
Acquire::Languages:: "none";
Acquire::http "";
Acquire::http::Pipeline-Depth "0";
Acquire::ForceIPv4 "true";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Pre-Invoke "";
DPkg::Pre-Invoke:: "echo running >/dev/shm/agu";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "rm -f /dev/shm/agu";
debug "";
debug::pkgproblemresolver "true";
Binary "apt-config";
Binary::apt "";
Binary::apt::APT "";
Binary::apt::APT::Color "1";
Binary::apt::APT::Cache "";
Binary::apt::APT::Cache::Show "";
Binary::apt::APT::Cache::Show::Version "2";
Binary::apt::APT::Cache::AllVersions "0";
Binary::apt::APT::Cache::ShowVirtuals "1";
Binary::apt::APT::Cache::Search "";
Binary::apt::APT::Cache::Search::Version "2";
Binary::apt::APT::Cache::ShowDependencyType "1";
Binary::apt::APT::Cache::ShowVersion "1";
Binary::apt::APT::Get "";
Binary::apt::APT::Get::Upgrade-Allow-New "1";
Binary::apt::APT::Cmd "";
Binary::apt::APT::Cmd::Show-Update-Stats "1";
Binary::apt::DPkg "";
Binary::apt::DPkg::Progress-Fancy "1";
Binary::apt::Acquire "";
Binary::apt::Acquire::AllowInsecureRepositories "0";
CommandLine "";
CommandLine::AsString "apt-config dump";
-- (no /etc/apt/preferences present) --
-- /etc/apt/sources.list --
# $Id: sid.tarent 4253 2014-12-21 16:36:15Z tglase $
#-
deb http://mirror.lan.tarent.de/debian sid main non-free contrib
deb http://http.debian.net/debian sid main non-free contrib
deb http://XXX:XXX@debs.tarent.de/ sid tarent wtf
deb http://XXX:XXX@debs.tarent.de/ lenny tarent wtf
deb http://XXX:XXX@debfremd.tarent.de/ lenny fremd
-- System Information:
Debian Release: stretch/sid
APT prefers buildd-unstable
APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
Versions of packages apt depends on:
ii adduser 3.113+nmu3
ii debian-archive-keyring 2014.3
ii gnupg 1.4.19-6
ii gpgv 1.4.19-6
ii libapt-pkg5.0 1.1
ii libc6 2.19-22
ii libgcc1 1:5.2.1-26
ii libstdc++6 5.2.1-26
apt recommends no packages.
Versions of packages apt suggests:
pn apt-doc <none>
pn aptitude | synaptic | wajig <none>
ii dpkg-dev 1.18.3
pn python-apt <none>
-- no debconf information
Reply to: