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