tasksel: forcefully removes packages when tasks overlap

Bug #574287 reported by Martin Erik Werner
118
This bug affects 22 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned
tasksel (Debian)
Fix Released
Unknown
tasksel (Ubuntu)
Confirmed
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned

Bug Description

TEST CASE

1. Boot Lucid LiveCD

2. run "sudo tasksel" and select "virtual machine host"

3. run "sudo tasksel" and deselect "virtual machine host"

4. watch how tasksel uninstalls your system

OBSERVATIONS

What seems to happen is that apt vengefully removes ALL of the items associated with one task, including several base dependencies of other tasks (e.g. ubuntu-desktop)

One illustrative example is the openssh-server task:
This one includes the packages openssh-server, tcpd and libwrap0.
From a normal ubuntu-desktop (e.g. ~liveCD) both tcpd and libwrap0 are already installed, and the task-install pulls in only openssh-server.
However when the task is removed, all these three packages (openssh-server, tcpd and libwrap0) are forcefully removed.
Since libwrap0 is a core dependency of gnome, a large part of gnome will be removed alongside the removal of the task.

Revision history for this message
Martin Erik Werner (arand) wrote :
Revision history for this message
Martin Erik Werner (arand) wrote :

Can confirm same problem on a Lucid virtualbox install.
Does not happen on one virtualbox Karmic install.

Likely dependent on state of packages on system.

Changed in tasksel (Ubuntu):
status: New → Confirmed
description: updated
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Eur Eka (eureka987) wrote :

I can confirm this bug on Ubuntu 10.04 Desktop i386, 2.6.32-22-generic-pae.
After first running the command "sudo tasksel install openssh-server" and then running the command "sudo tasksel remove openssh-server" packages from two meta packages got affected.
Several packages from both the ubuntu-desktop and the ubuntu-restricted-extras meta packages were removed.
I fixed it by running the command "sudo tasksel install ubuntu-desktop" and then reinstalling some packages that had been removed from the ubuntu-restricted-extras meta package.

Revision history for this message
Martin Erik Werner (arand) wrote :
Download full text (4.1 KiB)

Easy test, maverick, previously installed openssh-server:

sudo tasksel remove openssh-server

grep remove /var/log/dpkg.log | grep 23:11 # (just to filter to the relevant time)

2010-06-02 23:11:07 startup packages remove
2010-06-02 23:11:15 remove ubuntu-desktop 1.198 1.198
2010-06-02 23:11:16 remove gdm-guest-session 0.15 0.15
2010-06-02 23:11:16 remove gdm 2.30.2-0ubuntu1 2.30.2-0ubuntu1
2010-06-02 23:11:18 remove gnome-applets 2.30.0-1ubuntu1 2.30.0-1ubuntu1
2010-06-02 23:11:18 remove indicator-me 0.2.6-0ubuntu1 0.2.6-0ubuntu1
2010-06-02 23:11:19 remove indicator-applet-session 0.4.1-0ubuntu1 0.4.1-0ubuntu1
2010-06-02 23:11:19 remove indicator-applet 0.4.1-0ubuntu1 0.4.1-0ubuntu1
2010-06-02 23:11:19 remove gnome-session 2.30.0-0ubuntu1 2.30.0-0ubuntu1
2010-06-02 23:11:20 update-alternatives: run with --remove x-session-manager /usr/bin/gnome-session
2010-06-02 23:11:20 update-alternatives: link group x-session-manager fully removed
2010-06-02 23:11:21 remove gnome-panel 1:2.30.0-0ubuntu1 1:2.30.0-0ubuntu1
2010-06-02 23:11:22 remove gnome-control-center 1:2.30.1-0ubuntu1 1:2.30.1-0ubuntu1
2010-06-02 23:11:22 remove gnome-media 2.30.0-0ubuntu1 2.30.0-0ubuntu1
2010-06-02 23:11:23 remove gnome-orca 2.31.2-0ubuntu1 2.31.2-0ubuntu1
2010-06-02 23:11:24 remove gnome-settings-daemon 2.30.1-0ubuntu1 2.30.1-0ubuntu1
2010-06-02 23:11:25 remove gstreamer0.10-pulseaudio 0.10.23-1ubuntu1 0.10.23-1ubuntu1
2010-06-02 23:11:25 remove hpijs 3.10.2-2ubuntu2 3.10.2-2ubuntu2
2010-06-02 23:11:25 remove hplip 3.10.2-2ubuntu2 3.10.2-2ubuntu2
2010-06-02 23:11:27 remove indicator-sound 0.2.3-0ubuntu1 0.2.3-0ubuntu1
2010-06-02 23:11:28 remove pulseaudio-module-x11 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:28 remove pulseaudio-module-gconf 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:29 remove pulseaudio-module-bluetooth 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:29 remove pulseaudio-esound-compat 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:29 remove libcanberra-pulse 0.24-1ubuntu1 0.24-1ubuntu1
2010-06-02 23:11:29 remove pulseaudio 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:30 remove libasound2-plugins 1.0.23-0ubuntu1 1.0.23-0ubuntu1
2010-06-02 23:11:30 remove libhpmud0 3.10.2-2ubuntu2 3.10.2-2ubuntu2
2010-06-02 23:11:31 remove pulseaudio-utils 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:31 remove libpulse-browse0 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:31 remove libpulse-mainloop-glib0 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu15
2010-06-02 23:11:32 remove libsdl1.2debian 1.2.14-4ubuntu1 1.2.14-4ubuntu1
2010-06-02 23:11:32 remove libsdl1.2debian-pulseaudio 1.2.14-4ubuntu1 1.2.14-4ubuntu1
2010-06-02 23:11:32 remove python-speechd 0....

Read more...

Revision history for this message
Martin Erik Werner (arand) wrote :

This is also the case If I simply do:
sudo apt-get remove openssh-server^ (note the caret to mark as a task)

Hence adding a task for apt

Revision history for this message
Martin Erik Werner (arand) wrote :

I've tested this on current Debian testing, and the problem exists, but is less problematic, since there seems to be much less overlap in the Debian tasks.

However one example is if the tasks: ~t^desktop. ~t^gnome-desktop and ~t^laptop, are installed and then the ~t^laptop task is removed. This will result in the removal of e.g. wpasupplicant, network-manager and network-manager-gnome, all of which are also a part of the ~t^gnome-desktop task.
I will take this upstream to Debian.

I've been told that the package sets are indeed defined by tasksel, hence the apt task would be invalid.

Changed in apt (Ubuntu):
status: New → Invalid
Revision history for this message
Martin Erik Werner (arand) wrote :
Changed in tasksel (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in tasksel (Debian):
status: Unknown → New
summary: - tasksel uninstalled my system!
+ tasksel: forcefully removes packages when tasks overlap
young-sin (d-yd-tls)
Changed in tasksel (Ubuntu):
assignee: nobody → young-sin (d-yd-tls)
Changed in tasksel (Ubuntu):
assignee: young-sin (d-yd-tls) → nobody
tags: added: testcase
Changed in tasksel (Ubuntu):
assignee: nobody → benjamin (varghese-benjamin09)
Revision history for this message
C de-Avillez (hggdh2) wrote :

@benjamin: please do not assign yourself or any one else to a bug unless you are actively working on resolving the issue. In this case, you can assign *yourself*, but should add a comment about it.

Changed in tasksel (Ubuntu):
assignee: benjamin (varghese-benjamin09) → nobody
Changed in tasksel (Ubuntu):
assignee: nobody → jeevithan (jeevithan1990)
status: Confirmed → In Progress
Revision history for this message
Martin Erik Werner (arand) wrote :

jeevithan: please do not assign yourself to the bug unless you are working on it, thanks.

Changed in tasksel (Ubuntu):
assignee: jeevithan (jeevithan1990) → nobody
status: In Progress → Confirmed
Revision history for this message
Martin Erik Werner (arand) wrote :

In Debian this has been resolved indirectly since tasksel now uses metapackages instead of tasks to define sets, this change is not present in Ubuntu currently.

Changed in tasksel (Debian):
status: New → Fix Released
Revision history for this message
Alex Ordonez (ordonezalex) wrote :

# sudo apt-get remove lamp-server^

Began removing my whole system. Force closed the terminal. I am glad I was reading the output, because my system still works for now (it just happened, so I will find out what damage was done).

ola aljundi (ola-jundi)
Changed in apt (Ubuntu):
status: Invalid → Confirmed
assignee: nobody → ola aljundi (ola-jundi)
Changed in tasksel (Ubuntu):
assignee: nobody → ola aljundi (ola-jundi)
Revision history for this message
Martina Neumayer (martina.neumayer) wrote :

Ok, here is some help to restore the system from "TTY_only" after tasksel removed important packages:

sudo apt-get install $(for i in $(cat /var/log/dpkg.log |grep -oP "(?<=`date +%Y-%m-%d`\s\d\d\:\d\d:\d\d\sremove)\s\S*\s"); do echo -n "$i "; done;)

Which basically looks in the dpkg.log for packages removed today and reinstalls them by handing the package-names over to apt-get. It also restores other packages :)

Changed in apt (Ubuntu):
assignee: ola aljundi (ola-jundi) → nobody
Changed in tasksel (Ubuntu):
assignee: ola aljundi (ola-jundi) → nobody
Changed in apt (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Martin Erik Werner (arand) wrote :

ola:
Please do not assign yourself to the bug unless you are working on it, thanks.

eMcE:
Yes, that might work in some cases.
It would be advisable though, to first do the grepping and then review the result before trying to reinstall everything from it, I have a feeling things could go even worse if one is not being careful there...

Also worth noting is that any automatically-installed states will have been lost, so that's something to keep in mind as well...

Revision history for this message
Alex Beamish (talexb) wrote :

What is going on with this bug?

I wanted to install SSH Server on my new Ubuntu 18.04 system, and so unchecked the things that were installed already, checked SSH Server .. and it's been busily uninstalling EVERYTHING. This is a disaster.

Revision history for this message
Elias M Ward (eliasward) wrote :

I just ran into this bug. Started uninstalling everything when I was removing lamp-server. Thankfully I caught it at about 15% and killed the session when I started noticing things disappearing. This is a critical disastrous bug. How has it not been touched in so long?

If it's not going to get fixed, at least remove tasksel out of production or at least remove the remove function from it. This is ridiculous.

Revision history for this message
Oliver Gerlich (ogerlich) wrote :

WTF. I was uninstalling the ubuntu-mate-desktop task with tasksel (while ubuntu-desktop was still checked in the list), and it removed basically everything. Afterwards all tasks in the tasksel list were unchecked. This is definitely not the expected behavior: when I uncheck a specific task, I don't expect other tasks to be removed as well.

I suggest to disable the package-removal functionality in tasksel. Alternatively, show a big warning when tasksel is about to remove anything. There are lots of warning posts about this behavior of tasksel all over the net, but if the warning does not appear in the application itself, I'm unlikely to see it before it's too late.

Revision history for this message
Colonel Angus (colonel-angus) wrote :

Like Elias M Ward, I installed lamp-server using taskel. It didn't work as expected and upon uninstalling, taskel removed everything. I came back to my desk, and the system was shot. No network, no desktop, nothing. Luckily, this was a fresh install, so a reinstall was the quickest way to get a usable system.

Very, very poorly thought out.

Ten years later? Wow.

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

The easiest way out would be to just remove tasksel once the d-i images are gone, and it's no longer needed.

Revision history for this message
barnaba (barnabaturek) wrote :

Well, I wasn't as lucky as Colonel Angus and my system wasn't a fresh install. Love having my day and OS ruined by a ten year old bug that doesn't even have importance decided.

If you're not planning to ever fix it maybe just add a warning to taskel that this tool isn't fit for regular users and we should not follow tutorials and just use apt instead?

Revision history for this message
Peter Ludwig (peter-ludwig) wrote :

Today I used tasksel to add "lubuntu-desktop" to an "ubuntu-desktop" installation. Already installed and noticed by tasksel was additionally: "SSH-Service" and "Print Server".

The installation of "lubunut-desktop" went fine. I logged in to lubuntu-desktop and now I wanted to remove the "ubuntu-desktop" only ... because it is an odroid and disk space is precoius.

I ran tasksel and deselected "ubuntu-Desktop".

I was logged in and was able to see how my desktop, start menue, icons ... were removed / uninstalled until in the end a completely naked dektop was left. I was not able to run tasksel again. So I had to reinstall again. :((

Ubuntu 18.04 on odroid u3.
 Image name:
"ubuntu-18.04-4.16.0-v7-desktop-odroid-u2-u3-20190308_shrink.img.xz"

Norbert (nrbrtx)
tags: added: bionic focal hirsute impish jammy rls-jj-incoming xenial
Dave Jones (waveform)
tags: removed: rls-jj-incoming
tags: added: rls-jj-incoming
tags: added: rls-kk-incoming
removed: rls-jj-incoming
Lukas Märdian (slyon)
tags: added: fr-1988
tags: removed: rls-kk-incoming
Tay Rake (divinityy)
Changed in apt (Ubuntu):
status: Invalid → Incomplete
status: Incomplete → Invalid
Revision history for this message
Brian Murray (brian-murray) 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: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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