Critical bug in tasksel: `tasksel remove task-name` removes whole system

Bug #1779645 reported by Norbert
12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
tasksel (Ubuntu)
Triaged
Critical
Unassigned
Kinetic
Won't Fix
Critical
Unassigned

Bug Description

Steps to reproduce:
1. Have Ubuntu 16.04 LTS or 18.04 LTS system installed with any desktop
2. Install `tasksel` package, install some task `sudo tasksel install samba-server`
3. Remove some task with for example `sudo tasksel remove samba-server`
4. Wait command to finish and reboot the system
5. Get broken system without GUI login

Expected results:
* `tasksel` removes only requested task

Actual results:
* `tasksel` removes requested task and almost whole system

Notes:
* the problem was discovered on AskUbuntu (https://askubuntu.com/q/1051022/66509) - please read my answer for analysis
* the problem caused by last dash in the remove command:

   $ sudo tasksel --test remove samba-server
   debconf-apt-progress -- apt-get -q -y -o APT::Install-Recommends=true -o APT::Get::AutomaticRemove=true -o APT::Acquire::Retries=3 install samba-server^-

if we remove it (change "samba-server^-" to "samba-server^") it will remove only one task.
You can compare on 16.04 LTS:

$ sudo apt-get -o APT::Install-Recommends=true -o APT::Get::AutomaticRemove=true -o APT::Acquire::Retries=3 install samba-server^-
  [sudo] password for xenial:
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  Note, selecting 'libldb1' for task 'samba-server'
  Note, selecting 'python-tdb' for task 'samba-server'
  Note, selecting 'libcups2' for task 'samba-server'
  Note, selecting 'python-samba' for task 'samba-server'
  Note, selecting 'rename' for task 'samba-server'
  Note, selecting 'libwbclient0' for task 'samba-server'
  Note, selecting 'python-dnspython' for task 'samba-server'
  Note, selecting 'python2.7-minimal' for task 'samba-server'
  Note, selecting 'samba' for task 'samba-server'
  Note, selecting 'samba-dsdb-modules' for task 'samba-server'
  Note, selecting 'libarchive13' for task 'samba-server'
  Note, selecting 'libavahi-common-data' for task 'samba-server'
  Note, selecting 'perl-modules-5.22' for task 'samba-server'
  Note, selecting 'libavahi-common3' for task 'samba-server'
  Note, selecting 'libpython2.7' for task 'samba-server'
  Note, selecting 'python2.7' for task 'samba-server'
  Note, selecting 'libaio1' for task 'samba-server'
  Note, selecting 'tdb-tools' for task 'samba-server'
  Note, selecting 'python' for task 'samba-server'
  Note, selecting 'cifs-utils' for task 'samba-server'
  Note, selecting 'libtalloc2' for task 'samba-server'
  Note, selecting 'python-talloc' for task 'samba-server'
  Note, selecting 'attr' for task 'samba-server'
  Note, selecting 'libperl5.22' for task 'samba-server'
  Note, selecting 'samba-libs' for task 'samba-server'
  Note, selecting 'python-crypto' for task 'samba-server'
  Note, selecting 'libpython-stdlib' for task 'samba-server'
  Note, selecting 'winbind' for task 'samba-server'
  Note, selecting 'samba-common' for task 'samba-server'
  Note, selecting 'samba-vfs-modules' for task 'samba-server'
  Note, selecting 'libfile-copy-recursive-perl' for task 'samba-server'
  Note, selecting 'libsmbclient' for task 'samba-server'
  Note, selecting 'smbclient' for task 'samba-server'
  Note, selecting 'samba-common-bin' for task 'samba-server'
  Note, selecting 'libtdb1' for task 'samba-server'
  Note, selecting 'libpython2.7-minimal' for task 'samba-server'
  Note, selecting 'perl' for task 'samba-server'
  Note, selecting 'python-ldb' for task 'samba-server'
  Note, selecting 'keyutils' for task 'samba-server'
  Note, selecting 'libpython2.7-stdlib' for task 'samba-server'
  Note, selecting 'libavahi-client3' for task 'samba-server'
  Note, selecting 'libtevent0' for task 'samba-server'
  Note, selecting 'python-minimal' for task 'samba-server'
  Note, selecting 'update-inetd' for task 'samba-server'
  Note, selecting 'liblzo2-2' for task 'samba-server'
  Package 'attr' is not installed, so not removed
  Package 'keyutils' is not installed, so not removed
  Package 'libaio1' is not installed, so not removed
  Package 'python-dnspython' is not installed, so not removed
  Package 'tdb-tools' is not installed, so not removed
  Package 'cifs-utils' is not installed, so not removed
  Package 'samba' is not installed, so not removed
  Package 'samba-dsdb-modules' is not installed, so not removed
  Package 'samba-vfs-modules' is not installed, so not removed
  Package 'winbind' is not installed, so not removed
  The following additional packages will be installed:
    foomatic-filters
  Recommended packages:
    cups-client | lpr | lprng | rlpr ghostscript colord
  The following packages will be REMOVED:
    a11y-profile-manager-indicator account-plugin-facebook account-plugin-flickr
    account-plugin-google acl adwaita-icon-theme apg app-install-data apport-gtk
    aptdaemon-data apturl apturl-common atril atril-common avahi-daemon
    avahi-discover avahi-dnsconfd avahi-utils bamfdaemon blueman bluez-cups
    bluez-obexd brasero brasero-cdrkit brasero-common build-essential
    ca-certificates-java caja caja-common caja-extensions-common caja-gksu
    caja-open-terminal caja-sendto caja-wallpaper cheese cheese-common colord
    colord-data compiz compiz-gnome compiz-mate compton cracklib-runtime cups
    cups-browsed cups-bsd cups-client cups-common cups-core-drivers cups-daemon
    cups-filters cups-filters-core-drivers cups-pk-helper cups-ppdc
    cups-server-common dc dconf-editor default-jre-headless deja-dup
    deja-dup-backend-cloudfiles deja-dup-backend-gvfs deja-dup-backend-s3
    deja-dup-caja diffstat dpkg-dev duplicity dvd+rw-tools enchant engrampa
    engrampa-common eom eom-common evolution-data-server
    evolution-data-server-common evolution-data-server-online-accounts fakeroot
    firefox folder-color-caja folder-color-common fonts-mathjax fonts-opensymbol
    fwupd g++ g++-5 galculator gcc gcc-5 gcr gdebi gdebi-core geoclue
    geoclue-ubuntu-geoip gettext ghostscript ghostscript-x
    gir1.2-appindicator3-0.1 gir1.2-atk-1.0 gir1.2-atspi-2.0 gir1.2-caja
    gir1.2-dbusmenu-glib-0.4 gir1.2-dee-1.0 gir1.2-freedesktop
    gir1.2-gdkpixbuf-2.0 gir1.2-gnomekeyring-1.0 gir1.2-gtk-2.0 gir1.2-gtk-3.0
    gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-javascriptcoregtk-4.0
    gir1.2-mate-panel gir1.2-notify-0.7 gir1.2-pango-1.0 gir1.2-peas-1.0
    gir1.2-rb-3.0 gir1.2-secret-1 gir1.2-soup-2.4 gir1.2-udisks-2.0
    gir1.2-unity-5.0 gir1.2-vte-2.91 gir1.2-webkit-3.0 gir1.2-webkit2-4.0
    gir1.2-wnck-1.0 gir1.2-wnck-3.0 gkbd-capplet gksu gnome-bluetooth
    gnome-desktop3-data gnome-disk-utility gnome-icon-theme
    gnome-icon-theme-symbolic gnome-keyring gnome-orca gnome-session-bin
    gnome-session-canberra gnome-settings-daemon-schemas gnome-system-monitor
    gnome-system-tools gnome-themes-standard gnome-themes-standard-data
    gnome-user-guide gnome-user-share gnome-video-effects growisofs
    gsettings-ubuntu-schemas gstreamer1.0-clutter-3.0 gstreamer1.0-nice
    gstreamer1.0-tools gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf
    gucharmap gufw gvfs-backends hardening-includes hexchat hexchat-common
    hexchat-perl hexchat-plugins hexchat-python hplip hplip-data
    humanity-icon-theme hunspell-en-us ibus indicator-applet
    indicator-application indicator-application-gtk2 indicator-bluetooth
    indicator-datetime indicator-keyboard indicator-messages indicator-power
    indicator-sound indicator-sound-gtk2 intltool-debian ippusbxd java-common
    language-selector-gnome liba11y-profile-manager-0.1-0 libabw-0.1-1v5
    libaccount-plugin-1.0-0 libaccount-plugin-generic-oauth
    libaccount-plugin-google libaccounts-glib0 libaccounts-qt5-1
    libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
    libappindicator1 libappindicator3-1 libappstream-glib8 libapt-pkg-perl
    libarchive-zip-perl libarchive13 libart-2.0-2 libasan2 libasm4-java
    libasprintf-dev libatk-adaptor libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data
    libatkmm-1.6-1v5 libatomic1 libatrildocument3 libatrilview3
    libauthen-sasl-perl libavahi-client3 libavahi-common-data libavahi-common3
    libavahi-compat-libdnssd1 libavahi-core7 libavahi-glib1 libbamf3-2
    libbasicusageenvironment1 libblas-common libblas3 libbluray-bdj
    libboost-date-time1.58.0 libbrasero-media3-1 libburn4 libc-dev-bin libc6-dev
    libcairo-perl libcairomm-1.0-1v5 libcaja-extension1 libcamel-1.2-54
    libcanberra-gtk-module libcanberra-gtk0 libcanberra-gtk3-0
    libcanberra-gtk3-module libcanberra-pulse libcanberra0 libcddb2
    libcdio-cdda1 libcdio-paranoia1 libcdr-0.1-1 libcgi-fast-perl libcgi-pm-perl
    libcheese-gtk25 libcheese8 libchromaprint0 libcilkrts5
    libclass-accessor-perl libclone-perl libclucene-contribs1v5
    libclucene-core1v5 libclutter-1.0-0 libclutter-1.0-common
    libclutter-gst-3.0-0 libclutter-gtk-1.0-0 libcmis-0.5-5v5 libcogl-common
    libcogl-pango20 libcogl-path20 libcogl20 libcolamd2.9.1 libcolord2
    libcolorhug2 libcompizconfig0 libconfig9 libconfuse-common libconfuse0
    libcrack2 libcups2 libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1
    libcupsppdc1 libdata-alias-perl libdbusmenu-glib4 libdbusmenu-gtk3-4
    libdbusmenu-gtk4 libdc1394-22 libdca0 libdfu1 libdigest-hmac-perl
    libdirectfb-1.2-9 libdmapsharing-3.0-2 libdpkg-perl libdvbpsi10
    libe-book-0.1-1 libebackend-1.2-10 libebml4v5 libebook-1.2-16
    libebook-contacts-1.2-2 libecal-1.2-19 libedata-book-1.2-25
    libedata-cal-1.2-28 libedataserver-1.2-21 libemail-valid-perl libenchant1c2a
    libencode-locale-perl libeot0 libetonyek-0.1-1 libevent-2.0-5 libexempi3
    libexif12 libexiv2-14 libexporter-tiny-perl libexttextcat-2.0-0 libfaad2
    libfakekey0 libfakeroot libfarstream-0.2-5 libfcgi-perl libfcitx-config4
    libfcitx-gclient0 libfcitx-utils0 libfftw3-single3 libfile-basedir-perl
    libfile-copy-recursive-perl libfile-desktopentry-perl libfile-fcntllock-perl
    libfile-listing-perl libfile-mimeinfo-perl libfont-afm-perl libfontembed1
    libfreehand-0.1-1 libfreerdp-cache1.1 libfreerdp-client1.1
    libfreerdp-codec1.1 libfreerdp-common1.1.0 libfreerdp-core1.1
    libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1
    libfreerdp-primitives1.1 libfreerdp-utils1.1 libfwupd1 libgail-3-0
    libgail-common libgail18 libgcab-1.0-0 libgcc-5-dev libgcr-ui-3-1 libgd3
    libgdata-common libgdata22 libgee-0.8-2 libgeoclue0 libgeocode-glib0
    libgeonames0 libgettextpo-dev libgettextpo0 libgexiv2-2 libgfortran3
    libgksu2-0 libglade2-0 libgles2-mesa libglew1.13 libglib-perl libgmime-2.6-0
    libgnome-bluetooth13 libgnome-desktop-3-12 libgnome-keyring-common
    libgnome-keyring0 libgnome-menu-3-0 libgnomekbd-common libgnomekbd8
    libgoa-1.0-0b libgoa-1.0-common libgpgme11 libgphoto2-6 libgphoto2-l10n
    libgphoto2-port12 libgrilo-0.2-1 libgroupsock8 libgs9 libgs9-common
    libgssdp-1.0-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2-perl
    libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtkmm-2.4-1v5 libgtkmm-3.0-1v5
    libgtksourceview2.0-0 libgtksourceview2.0-common libgtkspell0 libgtop-2.0-10
    libgtop2-common libgucharmap-2-90-7 libgupnp-1.0-4 libgupnp-igd-1.0-4
    libgusb2 libgutenprint2 libgweather-3-6 libgweather-common libgxps2
    libharfbuzz-icu0 libhpmud0 libhtml-form-perl libhtml-format-perl
    libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
    libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
    libhttp-message-perl libhttp-negotiate-perl libhunspell-1.3-0 libhyphen0
    libibus-1.0-5 libical1a libido-0.1-0 libido3-0.1-0 libieee1284-3 libijs-0.35
    libindicator3-7 libindicator7 libio-html-perl libio-pty-perl
    libio-socket-inet6-perl libio-socket-ssl-perl libio-string-perl
    libipc-run-perl libipc-system-simple-perl libiso9660-8 libisofs6 libitm1
    libjasper1 libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0
    libjavascriptcoregtk-4.0-18 libjbig2dec0 libjs-mathjax libjson-glib-1.0-0
    libjson-glib-1.0-common libjte1 libkate1 libkeybinder-3.0-0 libkpathsea6
    liblangtag-common liblangtag1 liblapack3 libldb1 liblightdm-gobject-1-0
    liblircclient0 liblist-moreutils-perl liblivemedia50 liblouis-data liblouis9
    liblouisutdml-bin liblouisutdml-data liblouisutdml6 liblsan0 liblua5.2-0
    liblwp-mediatypes-perl liblwp-protocol-https-perl liblzo2-2
    libmailtools-perl libmarco-private0 libmate-desktop-2-17 libmate-menu2
    libmate-panel-applet-4-1 libmate-sensors-applet-plugin0 libmate-slab0
    libmate-window-settings1 libmatedict6 libmatekbd-common libmatekbd4
    libmatemixer-common libmatemixer0 libmateweather-common libmateweather1
    libmatroska6v5 libmeanwhile1 libmediaart-2.0-0 libmessaging-menu0
    libmetacity-private3a libmhash2 libminiupnpc10 libmpcdec6 libmpx0
    libmspub-0.1-1 libmwaw-0.3-3 libmythes-1.2-0 libnatpmp1
    libnautilus-extension1a libneon27-gnutls libnet-dbus-perl libnet-dns-perl
    libnet-domain-tld-perl libnet-http-perl libnet-ip-perl libnet-libidn-perl
    libnet-smtp-ssl-perl libnet-ssleay-perl libnice10 libnm-glib-vpn1
    libnm-glib4 libnm-gtk-common libnm-gtk0 libnm-util2 libnma-common libnma0
    libnspr4 libnss-mdns libnss3 libnss3-nssdb liboauth0 libodfgen-0.1-1
    liboobs-1-5 liborcus-0.10-0v5 libpagemaker-0.0-0 libpanel-applet0
    libpango-perl libpangomm-1.4-1v5 libpangoxft-1.0-0
    libparse-debianchangelog-perl libpeas-1.0-0 libpeas-1.0-0-python3loader
    libpeas-common libperl5.22 libperlio-gzip-perl libplank-common libplank1
    libpoppler-glib8 libprotobuf9v5 libproxy-tools libpulse-mainloop-glib0
    libpurple-bin libpurple0 libpwquality-common libpwquality1 libpython-stdlib
    libpython2.7 libpython2.7-minimal libpython2.7-stdlib libqpdf21
    libqt5libqgtk2 libqt5opengl5 libqt5printsupport5 libqt5webkit5
    libqt5x11extras5 libqt5xml5 libquadmath0 libquvi-scripts libquvi7
    libraptor2-0 librasqal3 libraw15 librdf0
    libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc
    libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk
    libreoffice-impress libreoffice-math libreoffice-ogltrans
    libreoffice-pdfimport libreoffice-writer libresid-builder0c2a librest-0.7-0
    librevenge-0.0-0 librhythmbox-core9 librsync1 libsane libsane-common
    libsane-hpaio libsbc1 libsdl-image1.2 libsdl1.2debian libsidplay2v5
    libsignon-extension1 libsignon-glib1 libsignon-plugins-common1
    libsignon-qt5-1 libsmbclient libsnmp-base libsnmp30 libsocket6-perl
    libsoup-gnome2.4-1 libspectre1 libstdc++-5-dev libsub-name-perl
    libsuitesparseconfig4.4.6 libtalloc2 libtcl8.6 libtdb1 libtevent0
    libtext-levenshtein-perl libtie-ixhash-perl libtimedate-perl
    libtimezonemap-data libtimezonemap1 libtk8.6 libtopmenu-client-gtk2-0
    libtopmenu-client-gtk3-0 libtopmenu-server-gtk2-0 libtopmenu-server-gtk3-0
    libtotem-plparser-common libtotem-plparser18 libtracker-sparql-1.0-0
    libtsan0 libubsan0 libunique-1.0-0 libunistring0 libunity-control-center1
    libunity-protocol-private0 libunity-scopes-json-def-desktop
    libunity-settings-daemon1 libunity9 libupnp6 libupower-glib3 liburi-perl
    liburl-dispatcher1 libusageenvironment3 libva-drm1 libva-x11-1 libvcdinfo0
    libvisio-0.1-1 libvlc5 libvlccore8 libvncclient1 libvorbisfile3
    libvte-2.91-0 libvte-2.91-common libvte-common libvte9 libwayland-cursor0
    libwayland-egl1-mesa libwbclient0 libwebkit2gtk-4.0-37
    libwebkit2gtk-4.0-37-gtk2 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common
    libwebkitgtk-3.0-0 libwebkitgtk-3.0-common libwebpdemux1 libwebpmux1
    libwebrtc-audio-processing-0 libwinpr-crt0.1 libwinpr-dsparse0.1
    libwinpr-environment0.1 libwinpr-file0.1 libwinpr-handle0.1 libwinpr-heap0.1
    libwinpr-input0.1 libwinpr-interlocked0.1 libwinpr-library0.1
    libwinpr-path0.1 libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1
    libwinpr-sspi0.1 libwinpr-synch0.1 libwinpr-sysinfo0.1 libwinpr-thread0.1
    libwinpr-utils0.1 libwnck-3-0 libwnck-3-common libwnck-common libwnck22
    libwpd-0.10-10 libwpg-0.3-3 libwps-0.4-4 libwww-perl libwww-robotrules-perl
    libx11-protocol-perl libxcb-composite0 libxcb-xv0 libxklavier16
    libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl libxres1
    libyajl2 libyaml-0-2 libyaml-libyaml-perl libyelp0 libzephyr4
    lightdm-gtk-greeter lightdm-gtk-greeter-settings lintian linux-libc-dev
    lp-solve make manpages-dev marco marco-common mate-applet-topmenu
    mate-applets mate-applets-common mate-control-center
    mate-control-center-common mate-desktop mate-desktop-common
    mate-desktop-environment-core mate-dock-applet mate-gnome-main-menu-applet
    mate-icon-theme mate-icon-theme-faenza mate-indicator-applet
    mate-indicator-applet-common mate-media mate-media-common mate-menu
    mate-menus mate-netbook mate-netbook-common mate-netspeed
    mate-netspeed-common mate-notification-daemon
    mate-notification-daemon-common mate-panel mate-panel-common mate-polkit
    mate-polkit-common mate-power-manager mate-power-manager-common
    mate-screensaver mate-screensaver-common mate-sensors-applet
    mate-sensors-applet-common mate-session-manager mate-settings-daemon
    mate-settings-daemon-common mate-system-monitor mate-system-monitor-common
    mate-terminal mate-terminal-common mate-themes mate-tweak mate-user-guide
    mate-utils mate-utils-common media-player-info menu menu-xdg metacity-common
    mousetweaks mozo mscompress nautilus nautilus-data nautilus-sendto
    network-manager-gnome network-manager-pptp-gnome notification-daemon onboard
    onboard-data openjdk-8-jre-headless p11-kit p11-kit-modules p7zip-full
    pastebinit patch patchutils perl perl-modules-5.22 pidgin pidgin-data
    pidgin-libnotify pinentry-gnome3 pinentry-gtk2 pkg-config plank pluma
    pluma-common policykit-1-gnome printer-driver-brlaser printer-driver-c2esp
    printer-driver-foo2zjs printer-driver-foo2zjs-common
    printer-driver-gutenprint printer-driver-hpcups printer-driver-pnm2ppa
    printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr
    printer-driver-sag-gdi printer-driver-splix pulseaudio
    pulseaudio-module-bluetooth pulseaudio-module-x11 python python-avahi
    python-boto python-cairo python-caja python-caja-common python-cffi-backend
    python-chardet python-cloudfiles python-configobj python-crypto
    python-cryptography python-dbus python-enum34 python-gdbm python-gi
    python-glade2 python-gobject python-gobject-2 python-gtk2
    python-gtksourceview2 python-idna python-ipaddress python-ldb
    python-lockfile python-mate-menu python-minimal python-ndg-httpsclient
    python-netifaces python-openssl python-pkg-resources python-pyasn1
    python-requests python-samba python-six python-talloc python-tdb
    python-urllib3 python-wnck python-xdg python-xlib python2.7
    python2.7-minimal python3-aptdaemon.gtk3widgets python3-brlapi python3-cairo
    python3-cups python3-cupshelpers python3-decorator python3-gi-cairo
    python3-louis python3-mako python3-numpy python3-pexpect python3-pil
    python3-polib python3-psutil python3-ptyprocess python3-pyatspi
    python3-pycurl python3-renderpm python3-reportlab python3-reportlab-accel
    python3-scipy python3-software-properties python3-speechd python3-xdg qpdf
    rename rhythmbox rhythmbox-data rhythmbox-plugin-cdrecorder
    rhythmbox-plugin-zeitgeist rhythmbox-plugins samba-common samba-common-bin
    samba-libs sane-utils seahorse session-migration sessioninstaller shotwell
    shotwell-common signon-keyring-extension signon-plugin-oauth2
    signon-plugin-password signon-ui signon-ui-service signon-ui-x11 signond
    simple-scan smbclient snapd software-properties-common
    software-properties-gtk sound-theme-freedesktop squashfs-tools ssl-cert
    synapse syslinux syslinux-common syslinux-legacy
    system-config-printer-common system-config-printer-gnome
    system-config-printer-udev system-tools-backends t1utils tcl tcl8.6
    thunderbird tilda tk tk8.6 topmenu-gtk2 topmenu-gtk3 transmission-common
    transmission-gtk ubuntu-mate-artwork ubuntu-mate-core
    ubuntu-mate-default-settings ubuntu-mate-desktop ubuntu-mate-icon-themes
    ubuntu-mate-libreoffice-draw-icons ubuntu-mate-lightdm-theme
    ubuntu-mate-themes ubuntu-mate-welcome ubuntu-mono
    ubuntu-release-upgrader-gtk ubuntu-system-service ubuntu-touch-sounds
    unity-asset-pool unity-control-center unity-control-center-signon
    unity-settings-daemon update-inetd update-manager update-notifier
    update-notifier-common upower usb-creator-common usb-creator-gtk vlc
    vlc-data vlc-nox vlc-plugin-notify vlc-plugin-samba xdg-user-dirs-gtk
    xul-ext-gdata-provider xul-ext-lightning yelp yelp-xsl zenity zenity-common
  The following NEW packages will be installed:
    foomatic-filters
  0 upgraded, 1 newly installed, 938 to remove and 8 not upgraded.
  Need to get 0 B/90,0 kB of archives.
  After this operation, 2 315 MB disk space will be freed.
  Do you want to continue? [Y/n]

with corrected command:

     xenial@xenial-vb:~$ sudo apt-get -o APT::Install-Recommends=true -o APT::Get::AutomaticRemove=true -o APT::Acquire::Retries=3 install samba-server^
   [sudo] password for xenial:
   Reading package lists... Done
   Building dependency tree
   Reading state information... Done
   Note, selecting 'libldb1' for task 'samba-server'
   Note, selecting 'python-tdb' for task 'samba-server'
   Note, selecting 'libcups2' for task 'samba-server'
   Note, selecting 'python-samba' for task 'samba-server'
   Note, selecting 'rename' for task 'samba-server'
   Note, selecting 'libwbclient0' for task 'samba-server'
   Note, selecting 'python-dnspython' for task 'samba-server'
   Note, selecting 'python2.7-minimal' for task 'samba-server'
   Note, selecting 'samba' for task 'samba-server'
   Note, selecting 'samba-dsdb-modules' for task 'samba-server'
   Note, selecting 'libarchive13' for task 'samba-server'
   Note, selecting 'libavahi-common-data' for task 'samba-server'
   Note, selecting 'perl-modules-5.22' for task 'samba-server'
   Note, selecting 'libavahi-common3' for task 'samba-server'
   Note, selecting 'libpython2.7' for task 'samba-server'
   Note, selecting 'python2.7' for task 'samba-server'
   Note, selecting 'libaio1' for task 'samba-server'
   Note, selecting 'tdb-tools' for task 'samba-server'
   Note, selecting 'python' for task 'samba-server'
   Note, selecting 'cifs-utils' for task 'samba-server'
   Note, selecting 'libtalloc2' for task 'samba-server'
   Note, selecting 'python-talloc' for task 'samba-server'
   Note, selecting 'attr' for task 'samba-server'
   Note, selecting 'libperl5.22' for task 'samba-server'
   Note, selecting 'samba-libs' for task 'samba-server'
   Note, selecting 'python-crypto' for task 'samba-server'
   Note, selecting 'libpython-stdlib' for task 'samba-server'
   Note, selecting 'winbind' for task 'samba-server'
   Note, selecting 'samba-common' for task 'samba-server'
   Note, selecting 'samba-vfs-modules' for task 'samba-server'
   Note, selecting 'libfile-copy-recursive-perl' for task 'samba-server'
   Note, selecting 'libsmbclient' for task 'samba-server'
   Note, selecting 'smbclient' for task 'samba-server'
   Note, selecting 'samba-common-bin' for task 'samba-server'
   Note, selecting 'libtdb1' for task 'samba-server'
   Note, selecting 'libpython2.7-minimal' for task 'samba-server'
   Note, selecting 'perl' for task 'samba-server'
   Note, selecting 'python-ldb' for task 'samba-server'
   Note, selecting 'keyutils' for task 'samba-server'
   Note, selecting 'libpython2.7-stdlib' for task 'samba-server'
   Note, selecting 'libavahi-client3' for task 'samba-server'
   Note, selecting 'libtevent0' for task 'samba-server'
   Note, selecting 'python-minimal' for task 'samba-server'
   Note, selecting 'update-inetd' for task 'samba-server'
   Note, selecting 'liblzo2-2' for task 'samba-server'
   libfile-copy-recursive-perl is already the newest version (0.38-1).
   libfile-copy-recursive-perl set to manually installed.
   libldb1 is already the newest version (2:1.1.24-1ubuntu3).
   libldb1 set to manually installed.
   liblzo2-2 is already the newest version (2.08-1.2).
   liblzo2-2 set to manually installed.
   libtalloc2 is already the newest version (2.1.5-2).
   libtalloc2 set to manually installed.
   libtdb1 is already the newest version (1.3.8-2).
   libtdb1 set to manually installed.
   python-ldb is already the newest version (2:1.1.24-1ubuntu3).
   python-ldb set to manually installed.
   python-talloc is already the newest version (2.1.5-2).
   python-talloc set to manually installed.
   python-tdb is already the newest version (1.3.8-2).
   python-tdb set to manually installed.
   rename is already the newest version (0.20-4).
   rename set to manually installed.
   update-inetd is already the newest version (4.43).
   update-inetd set to manually installed.
   libarchive13 is already the newest version (3.1.2-11ubuntu0.16.04.3).
   libarchive13 set to manually installed.
   libavahi-client3 is already the newest version (0.6.32~rc+dfsg-1ubuntu2.2).
   libavahi-client3 set to manually installed.
   libavahi-common-data is already the newest version (0.6.32~rc+dfsg-1ubuntu2.2).
   libavahi-common-data set to manually installed.
   libavahi-common3 is already the newest version (0.6.32~rc+dfsg-1ubuntu2.2).
   libavahi-common3 set to manually installed.
   libcups2 is already the newest version (2.1.3-4ubuntu0.4).
   libcups2 set to manually installed.
   libperl5.22 is already the newest version (5.22.1-9ubuntu0.5).
   libperl5.22 set to manually installed.
   libpython-stdlib is already the newest version (2.7.12-1~16.04).
   libpython-stdlib set to manually installed.
   libpython2.7 is already the newest version (2.7.12-1ubuntu0~16.04.3).
   libpython2.7 set to manually installed.
   libpython2.7-minimal is already the newest version (2.7.12-1ubuntu0~16.04.3).
   libpython2.7-minimal set to manually installed.
   libpython2.7-stdlib is already the newest version (2.7.12-1ubuntu0~16.04.3).
   libpython2.7-stdlib set to manually installed.
   libsmbclient is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   libsmbclient set to manually installed.
   libtevent0 is already the newest version (0.9.28-0ubuntu0.16.04.1).
   libtevent0 set to manually installed.
   libwbclient0 is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   libwbclient0 set to manually installed.
   perl is already the newest version (5.22.1-9ubuntu0.5).
   perl set to manually installed.
   perl-modules-5.22 is already the newest version (5.22.1-9ubuntu0.5).
   perl-modules-5.22 set to manually installed.
   python is already the newest version (2.7.12-1~16.04).
   python set to manually installed.
   python-crypto is already the newest version (2.6.1-6ubuntu0.16.04.3).
   python-crypto set to manually installed.
   python-minimal is already the newest version (2.7.12-1~16.04).
   python-minimal set to manually installed.
   python-samba is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   python-samba set to manually installed.
   python2.7 is already the newest version (2.7.12-1ubuntu0~16.04.3).
   python2.7 set to manually installed.
   python2.7-minimal is already the newest version (2.7.12-1ubuntu0~16.04.3).
   python2.7-minimal set to manually installed.
   samba-common is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   samba-common set to manually installed.
   samba-common-bin is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   samba-common-bin set to manually installed.
   samba-libs is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   samba-libs set to manually installed.
   smbclient is already the newest version (2:4.3.11+dfsg-0ubuntu0.16.04.13).
   smbclient set to manually installed.
   Suggested packages:
     bind9 bind9utils ctdb ldb-tools smbldap-tools libnss-winbind libpam-winbind
   The following packages will be REMOVED:
     libpaps0 paps
   The following NEW packages will be installed:
     attr cifs-utils keyutils libaio1 python-dnspython samba samba-dsdb-modules
     samba-vfs-modules tdb-tools winbind
   0 upgraded, 10 newly installed, 2 to remove and 8 not upgraded.
   Need to get 0 B/2 049 kB of archives.
   After this operation, 16,6 MB of additional disk space will be used.
   Do you want to continue? [Y/n]

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: tasksel 3.34ubuntu3
ProcVersionSignature: Ubuntu 4.4.0-128.154-generic 4.4.131
Uname: Linux 4.4.0-128-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CurrentDesktop: MATE
Date: Mon Jul 2 13:15:29 2018
InstallationDate: Installed on 2018-01-04 (178 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
SourcePackage: tasksel
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Norbert (nrbrtx) wrote :
Revision history for this message
Rafal (rjtskolasinski) wrote :

I was hit by this bug yesterday.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tasksel (Ubuntu):
status: New → Confirmed
Revision history for this message
Wulf Kixxot (kixxot) wrote :

A few minutes ago, I just made the massive mistake of running "tasksel remove samba-server" (Which I had installed using tasksel install samba-server).

For all practical purposes, my entire system is gone. It boots, but nothing else works. Databases, web services, xfce, python, everything gone. Poof!

Thanks, (I guess).

Norbert (nrbrtx)
tags: added: disco
removed: artful
Norbert (nrbrtx)
tags: added: eoan
Revision history for this message
Norbert (nrbrtx) wrote :
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Duplicate of bug 574287?

Revision history for this message
Maks G (maksg00) wrote :
Norbert (nrbrtx)
tags: added: focal hirsute impish
removed: cosmic disco eoan
Revision history for this message
Norbert (nrbrtx) wrote :
tags: added: jammy rls-jj-incoming
Dave Jones (waveform)
tags: removed: rls-jj-incoming
Revision history for this message
Norbert (nrbrtx) wrote :

@Dave Jones (waveform)
It will be very helpful and useful to have this critical bug in next LTS version, is not it?

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

I believe the tag was removed incorrectly so I'm readding it.

tags: added: rls-jj-incoming
Changed in tasksel (Ubuntu):
importance: Undecided → Critical
tags: added: rls-kk-incoming
removed: rls-jj-incoming
Revision history for this message
Norbert (nrbrtx) wrote :

I would prefer to have this bug fixed in the next LTS - 22.04 LTS. KK is too unclear.

Lukas Märdian (slyon)
tags: added: fr-1988
Revision history for this message
Julian Andres Klode (juliank) wrote :

> * the problem caused by last dash in the remove command:
>
> $ sudo tasksel --test remove samba-server
> debconf-apt-progress -- apt-get -q -y -o APT::Install-Recommends=true -o > APT::Get::AutomaticRemove=true -o APT::Acquire::Retries=3 install samba-server^-

This makes no sense, if you remove the -, you *install* samba-server task. Of course installing the task does not remove the task.

Changed in tasksel (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Julian Andres Klode (juliank) wrote :

What _really_ happens here is that the samba-server task has overlap with another task, so if you remove it, you will remove part of the other task. This has significantly improved since 16.04 I believe though, as apt will only remove the overlapping packages and the metapackages, and mark the meta package dependencies as manually installed.

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

But also that's why tasksel should not be used, and if you use apt remove samba-server^ (apt install samba-server^) you have to be careful. You can of course only run apt remove --auto-remove samba-server, this is safer. However this will result in some packages from the task remaining on the system, which is not the design choice taken by tasksel.

Because if you change it to do the other thing it (a) does not work for pre-18.04 installs; and (b) people will report a bug saying they have leftover packages from the task installed.

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

Reopening this because we still want to address this by one of two ways:

1) Remove tasksel from the archive (preferred)
2) Remove the ability in tasksel to remove tasks

Changed in tasksel (Ubuntu):
status: Invalid → Triaged
tags: removed: rls-kk-incoming
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Ubuntu 22.10 (Kinetic Kudu) has reached end of life, so this bug will not be fixed for that specific release.

Changed in tasksel (Ubuntu Kinetic):
status: Triaged → Won't Fix
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.