After removing a package from tasksel all other package also removed [duplicate]
I tried to remove samba-server
with this command (sudo tasksel remove samba-server
) and every app even the system apps are deleted and now xubuntu is stuck at boot, just showing loading. What should I do?
Did tasksel
deleted my files too?
Solution 1:
TL;DR - it is a serious bug, do not use tasksel for removing things!
Analysis
Below is available options of tasksel
:
$ tasksel --help
Unknown option: help
Usage:
tasksel install <task>...
tasksel remove <task>...
tasksel [options]
-t, --test test mode; don't really do anything
--new-install automatically install some tasks
--list-tasks list tasks that would be displayed and exit
--task-packages list available packages in a task
--task-desc returns the description of a task
Samba task is named as samba-server
as you wrote:
$ tasksel --list-tasks | grep -i Samba
u samba-server Samba file server
It consists of only one package:
$ tasksel --task-packages samba-server
samba-server^
If we try to simulate uninstall - we get the following line:
$ 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^-
(in the line above the last hyphen -
cause problems).
What I did:
- Booted Ubuntu 18.04 LTS clean VM, installed
tasksel
withsudo apt-get install tasksel
- Installed Samba with
sudo tasksel install samba-server
- Ran
sudo tasksel remove samba-server
- Rebooted and got broken system on next boot
Fix the system
Then I tried to repair the system:
-
We need to boot in Recovery mode (click Shift on boot, in GRUB select Advanced options for Ubuntu, select Ubuntu, with Linux ... (recovery mode))
-
Select
resume Resume normal boot
to access login shell -
Open first console #1 with Ctrl+Alt+1 then login
-
If you do not have internet - check Ethernet interface name and run DHCP-client manually on it:
ifconfig -a # got enp0s3 sudo dhclient enp0s3
-
Reinstall
xubuntu-desktop
meta-package to the system:sudo apt-get install xubuntu-desktop
-
After reboot I can access the system.
Conclusion
So it seems that it is a serious bug - I have found some with almost same symptoms:
- bug 574287 reported on on 2010-05-03 - "tasksel: forcefully removes packages when tasks overlap"
- bug 1338223 reported on 2014-07-06 - "Tasksel has deleted all my data!".
Also I have filed new bug 1779645 "Critical bug in tasksel: tasksel remove task-name
removes whole system"