Add 'tasks' section to default APT::Never-MarkAuto-Sections list
Task packages need to be handled just like metapackages so that users don't accidentally autoremove half of their system after removing one of task's dependencies.
For example, this is what one gets when removing konqueror in a typical KDE desktop installation:
$ sudo apt purge konqueror
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
apper apper-data coinor-libcbc3 coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5 coinor-libcoinutils3v5
coinor-libosi1v5 cups-pk-helper espeak-ng-data fonts-opensymbol fonts-symbola gir1.2-atk-1.0
gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-gstreamer-1.0 gir1.2-gtk-3.0
gir1.2-harfbuzz-0.0 gir1.2-notify-0.7 gir1.2-pango-1.0 gir1.2-secret-1 gir1.2-wnck-3.0 gstreamer1.0-libav
gstreamer1.0-plugins-ugly hyphen-en-us iw kdeaccessibility kmag kmousetool kmouth kontrast libabw-0.1-1
libatk-adaptor libboost-iostreams1.74.0 libboost-locale1.74.0 libbox2d2 libbrlapi0.8 libcdr-0.1-1
libclucene-contribs1v5 libclucene-core1v5 libdotconf0 libe-book-0.1-1 libeot0 libepubgen-0.1-1
libespeak-ng1 libetonyek-0.1-1 libexttextcat-2.0-0 libexttextcat-data libfreehand-0.1-1 libglu1-mesa
libharfbuzz-icu0 libicu67 libkf5konq6 liblangtag-common liblangtag1 libmhash2 libmspub-0.1-1 libmwaw-0.3-3
libmythes-1.2-0 libnumbertext-1.0-0 libnumbertext-data libodfgen-0.1-1 libopencore-amrnb0
libopencore-amrwb0 liborcus-0.17-0 liborcus-parser-0.17-0 libpagemaker-0.0-0 libpangoxft-1.0-0 libpcaudio0
libqt5opengl5 libqt5xmlpatterns5 libqxp-0.0-0 libraptor2-0 librasqal3 librdf0 libreoffice-base-core
libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-help-common
libreoffice-help-en-us libreoffice-impress libreoffice-kf5 libreoffice-math libreoffice-plasma
libreoffice-qt5 libreoffice-style-breeze libreoffice-style-colibre libreoffice-writer librevenge-0.0-0
libsidplay1v5 libsonic0 libstaroffice-0.0-0 libstartup-notification0 libuno-cppu3 libuno-cppuhelpergcc3-3
libuno-purpenvhelpergcc3-3 libuno-sal3 libuno-salhelpergcc3-3 liburing1 libusb-0.1-4 libvisio-0.1-1
libwnck-3-0 libwnck-3-common libwpd-0.10-10 libwpg-0.3-3 libwps-0.4-4 libxmlsec1-nss libyajl2 libzmf-0.0-0
lp-solve mythes-en-us node-clipboard node-normalize.css node-prismjs orca perl-tk print-manager
python3-brlapi python3-cairo python3-cups python3-cupshelpers python3-louis python3-pyatspi python3-smbc
python3-speechd python3-uno python3-xdg qtgstreamer-plugins-qt5 sound-icons speech-dispatcher
speech-dispatcher-audio-plugins speech-dispatcher-espeak-ng system-config-printer-common
system-config-printer-udev task-desktop uno-libs-private ure x11-apps x11-session-utils xbrlapi xinit
xkbset xorg
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
kde-baseapps* kde-plasma-desktop* kde-standard* konq-plugins* konqueror* task-kde-desktop*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 30.6 MB disk space will be freed.
Do you want to continue? [Y/n]
After applying this MR the list of packages to autoremove is reduced just to konqueror's own dependencies:
$ sudo apt purge konqueror
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libkf5konq6
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
kde-baseapps* kde-plasma-desktop* kde-standard* konq-plugins* konqueror* task-kde-desktop*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 30.6 MB disk space will be freed.