Never-MarkAuto-Sections not working

Bug #1721364 reported by Brian Murray
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Debian)
Opinion
Undecided
Unassigned
apt (Ubuntu)
Opinion
High
Unassigned

Bug Description

"apt-get --purge autoremove ubuntu-standard" wants to remove a lot more packages than just ubuntu-standard. Bug 1479207 is a previous version of this.

Using apt version 1.5 on Artful Aardvark:

The following packages will be REMOVED:
  accountsservice* apparmor* bind9-host* busybox-static* command-not-found* command-not-found-data* cpio* cron* dbus* dh-python* distro-info-data* dmidecode* dnsutils*
  friendly-recovery* ftp* fuse* geoip-database* gettext-base* gir1.2-glib-2.0* hdparm* info* iptables* iputils-tracepath* irqbalance* iso-codes* krb5-locales*
  language-selector-common* libaccountsservice0*...

This does work correctly on Trusty with apt version 1.0.1ubuntu2.17.

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  ubuntu-standard*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 61.4 kB disk space will be freed.
Do you want to continue? [Y/n] n

tags: added: artful rls-aa-incoming xenial zesty
Revision history for this message
Brian Murray (brian-murray) wrote :

Similar incorrect behavior is also seen with Ubuntu 16.04 and Ubuntu 17.04.

Ubuntu 16.04 with apt version 1.2.25

# apt-get --purge autoremove ubuntu-standard
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  accountsservice* apt-transport-https* bind9-host* busybox-static* ca-certificates* command-not-found* command-not-found-data* cpio* cron* distro-info-data* dmidecode*
  dnsutils* friendly-recovery* ftp* fuse* geoip-database* gettext-base* ...

Ubuntu 17.04 with apt version 1.4.6~17.04.1

# apt-get --purge autoremove ubuntu-standard
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  accountsservice* apparmor* apt-transport-https* bind9-host* busybox-static* ca-certificates* command-not-found* command-not-found-data* cpio* cron* dbus* dh-python*
  distro-info-data* dmidecode* dnsutils* friendly-recovery* ftp* fuse* geoip-database* gettext-base* gir1.2-glib-2.0*...

Changed in apt (Ubuntu):
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote :

Using the test in debian bug 793360.

$ sudo apt-mark showmanual >before
$ sudo apt-get -o Debug::pkgDepCache::AutoInstall=true install ubuntu-standard
[...]
$ sudo apt-mark showmanual >after
$ diff -u before after
--- before 2017-10-04 11:36:41.967980781 -0700
+++ after 2017-10-04 11:37:47.615979019 -0700
@@ -119,6 +119,7 @@
 tar
 tzdata
 ubuntu-keyring
+ubuntu-standard
 util-linux
 vim
 xz-utils

Only ubuntu-standard was marked as manually installed and none of its dependencies were. ubuntu-standard has a section of "metapackages" and some of my apt-config follows:

# apt-config dump | grep Sections
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";

Revision history for this message
Brian Murray (brian-murray) wrote :

I've also confirmed this incorrect behavior with debian/sid and apt 1.5.

$ sudo apt-mark showmanual >before
$ sudo apt-get -o Debug::pkgDepCache::AutoInstall=true install ros-desktop
[...]
$ sudo apt-mark showmanual >after
root@golden-raccoon:~# diff -u before after
--- before 2017-10-04 19:16:05.171917363 +0000
+++ after 2017-10-04 19:18:06.323914112 +0000
@@ -116,6 +116,7 @@
 passwd
 perl-base
 procps
+ros-desktop
 sed
 sensible-utils
 systemd

Revision history for this message
Julian Andres Klode (juliank) wrote :

The behavior as specified in the bug report and the comments is intended.

When installing a package in never mark auto, it is not marked as auto. On removal, dependencies of it will be

(1) marked as manually if the package was removed as a result of a conflict or something
(2) kept as automatic if the package was removed explicitly

The old implementation that just marked all stuff as manual led to the problem that installing a meta package and explicitly removing it did not remove any dependencies.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Conflict or something = If the meta package cannot be kept installed because a dependency broke, APT will mark the remaining dependencies as manually installed when removing the meta package.

But if you remove the meta package explicitly, you usually want to remove the dependencies of it as well.

Revision history for this message
Julian Andres Klode (juliank) wrote :
Changed in apt (Ubuntu):
status: New → Opinion
Changed in apt (Debian):
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.