Thursday, March 10, 2011

Tasksel remove might break your system

I wrote in one of my last articles that it's handy to use the 'tasksel' command to install complete packages (called tasks in Ubuntu/Debian) like samba server or a virtual machine host. These are comparable with server roles & features as Microsoft calls that. I've been doing some more reading into this, but at the moment it is NOT advised to remove tasks with tasksel, as it might remove more then you'd like. Which in turn could render your system more or less unusable. 

For those of you who'd like to read more info on this issue, or follow it in the bug tracker, here are the Ubuntu and Debian links for this issue:

One half baked workaround would be to list the tasks (possibly using grep to speed it up):

tasksel --list-tasks | grep samba
i samba-server  Samba file server
the 'i' in front means this task is installed, a 'u' would mean it isnt.
So now we now that the samba task is called 'samba-server', which we can use to find out which packages are used in installing this task:
tasksel --task-packages samba-server

Another way of doing this is by 'test' removing the task (so a test run that wont do anything):
tasksel -t remove samba-server
debconf-apt-progress -- apt-get -q -y install libfile-copy-recursive-perl- libavahi-common3- libavahi-client3- cifs-utils- libtalloc2- smbfs- libcups2- winbind- samba-common-bin- libavahi-common-data- smbclient- samba-common- libwbclient0- samba-doc- libpam-smbpass- update-inetd- samba-

After this we could make a well educated guess that 'samba' is the main package and just remove that with an:
sudo apt-get remove samba
or if you really want to get rid of the configuration files as well:
sudo apt-get purge samba

Finding out which package to remove might be a bit tricky (especially in larger tasks then something as simple as samba), so let's just hope they solve this issue soon by fixing the bug, or removing the remove option from tasksel.

EDIT: later I found you can actually just type 'aptitude' and that will ALSO list the tasks, but apparently in this way it's safe to remove... I didn't test this myself, so be careful.

No comments:

Post a Comment