Ubuntu

tasksel: forcefully removes packages when tasks overlap

Reported by Martin Erik Werner on 2010-05-03
90
This bug affects 16 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Undecided
Unassigned
tasksel (Debian)
Fix Released
Unknown
tasksel (Ubuntu)
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.

Martin Erik Werner (arand) wrote :
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
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.

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...

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

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
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) on 2011-06-13
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)
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
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
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

# 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) on 2013-03-11
Changed in apt (Ubuntu):
status: Invalid → Confirmed
assignee: nobody → ola aljundi (ola-jundi)
Changed in tasksel (Ubuntu):
assignee: nobody → ola aljundi (ola-jundi)
eMcE (emce) 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
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...

To post a comment you must log in.
This report contains Public information  Edit
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.