Tasksel or plain Apt?
In the past I've always used tasksel
to install so-called "tasks". It seems, however, that this has been integrated in APT:
apt-cache dumpavail | grep ^Task
[...] snip
Task: lamp-server
[...]
and that I can install such "tasks" by appending a caret (^
) to it, like this:
sudo apt-get install lamp-server^
Is this equivalent to the following?
sudo tasksel install lamp-server
And which is preferred?
Metapackages
Additionally, how do metapackages come into play here? Some tasks seem not to be a metapackage while others are:
apt-cache show lamp-server
N: Unable to locate package lamp-server
apt-cache show kubuntu-desktop
Package: kubuntu-desktop
[...]
Task: kubuntu-desktop
So, using the last example, what is the difference between the following three possible ways to install?
sudo apt-get install kubuntu-desktop
sudo apt-get install kubuntu-desktop^
sudo tasksel install kubuntu-desktop
In short: There is a difference between tasksel and apt-get installation process of tasks.
Looking at your example:
The apt-get way
sudo apt-get install 'lamp-server^'
will evaluate to do the following:Install those packages the standard way:
The tasksel way
sudo tasksel install lamp-server
will look for a task called "lamp-server" in one of its configuration files under/usr/share/tasksel/**/*.desc
:/usr/lib/tasksel/info/lamp-server.preinst
. If it exists execute this script.Install packages with apt-get using following command:
Look for
/usr/lib/tasksel/info/lamp-server.postinst
. If it exists execute this script.Conclusion
tasksel is more powerful in processing and selecting tasks. It can execute extra scripts before/after installation/removal of tasks. And the biggest benefit: You can modify tasks and create new ones very easily. It is not possible to edit an official package list file without drawbacks (valid signature).
Back to your first question:
In your special case both commands are almost equivalent (supposed you have enabled both
APT::Install-Recommends
andAPT::Get::AutomaticRemove
). Only difference is the extended package state ofmysql-server
andapache2
dependencies (set to "manually installed" with plain apt-get).And what about metapackages?
If you don't make use of tasksel's features like selecting tasks (especially helpful at installation) and executing extra commands before and after some task blocks then a task is very similar to a metapackage. The difference is: A task is not registered as a package in APT cache.
So if you uninstall one task-dependency other task-deps aren't marked as auto-installed because they were explicitely installed. If you uninstall a metapackage the dependencies are removed with
autoremove
because their extended package state is "auto installed" (if not installed manually).Note: All distributed tasks in Debian install a metapackage named
task-TASKNAME
.Giving your example:
sudo apt-get install kubuntu-desktop
kubuntu-desktop
. Dependencies are "auto installed".sudo apt-get install kubuntu-desktop^
kubuntu-desktop
. They all are marked as "manually installed".sudo tasksel install kubuntu-desktop
kubuntu-desktop
. Dependencies are "auto installed".