1. Overview
Debian-based distros have predefined sets of packages called tasks. They supply all the software for a particular need, such as a LAMP server, a mail server, an SSH server, and more.
In this tutorial, we’ll see how to use tasksel, a command-line tool, to install these tasks. We’ll explore tasksel‘s menu-driven interface and its command-line options.
2. tasksel vs. apt
Both apt and tasksel install deb packages, but their use is different. apt is a lower-level tool intended for individual packages, and tasksel is a higher-level tool designed for tasks. *Yet, there’s a likeness, as tasksel‘s tasks and apt‘s metapackages have similar goals*.
The tasksel tool’s main use is inside the Debian installer, as the following image shows:
This other screenshot is tasksel‘s menu inside of a Debian terminal:
As you can see, it’s the same menu. Yet, other Debian-based distros have a different approach. For example, Ubuntu and Linux Mint installers don’t use and don’t preinstall tasksel.
3. Usage
If tasksel isn’t available by default, we can install it using apt:
$ sudo apt install tasksel
Note: an undocumented issue with Ubuntu and Ubuntu-based distros hides the available tasks. We’ll see how to work around it. In what follows, we’ll refer to Debian 11.6, Ubuntu 22.04, and Linux Mint 21.1.
Moreover, once we’ve installed a task, it is best not to try to remove it, as the yet unsolved bug #574287 suggests.
3.1. The Debian Way
The previous two screenshots show the tasksel graphical menu on Debian. Its use is intuitive and fully compatible with remote management of a server, e.g., via ssh.
From the command line, we can list the available tasks. Let’s note that an i prefixes installed tasks, and a u prefixes uninstalled tasks:
# tasksel --list-task
i desktop Debian desktop environment
i gnome-desktop GNOME
u xfce-desktop Xfce
u gnome-flashback-desktop GNOME Flashback
u kde-desktop KDE Plasma
u cinnamon-desktop Cinnamon
u mate-desktop MATE
u lxde-desktop LXDE
u lxqt-desktop LXQt
u web-server web server
u ssh-server SSH server
i laptop laptop
We can also inspect the packages included in a task:
# tasksel --task-packages ssh-server
task-ssh-server
This result means that the ssh-server task includes only one metapackage. Let’s inspect its dependencies with apt-cache:
# apt-cache depends task-ssh-server
task-ssh-server
Depends: tasksel
Depends: openssh-server
Recommends: openssh-client
But that’s not all. Even better, we can inspect dependencies recursively with apt-rdepends. We trimmed the output because it’s very large:
# apt-rdepends openssh-server
[...]
openssh-server
Depends: adduser (>= 3.9)
[...]
Depends: openssh-client (= 1:8.4p1-5+deb11u1)
Depends: openssh-sftp-server
[...]
And finally, we can proceed to install that task:
# tasksel install ssh-server
A progress bar will show the required packages installation:
We can try this last example with the –test flag. In this way, tasksel simulates its behavior without actually installing anything.
3.2. The Ubuntu Way
Ubuntu 22.04 and derived distros show the same tasksel menu as Debian. Moreover, the list of packages via tasksel –list-task is also the same as on Debian. Yet, Ubuntu-based distros have dozens of additional helpful tasks. For example, a very well-known task is lamp-server, which allows us to install the entire LAMP stack with one command.
The key workaround for installing Ubuntu extra tasks is apt in the following way. Of course, we have to replace task-name with the actual task name. Let’s note the caret ^ character at the end:
# apt install task-name^
For example, we can install the lamp-server task this way:
# apt install lamp-server^
[...]
Note, selecting 'mysql-server-8.0' for task 'lamp-server'
[...]
Note, selecting 'mysql-client-8.0' for task 'lamp-server'
[...]
Note, selecting 'php8.1-mysql' for task 'lamp-server'
[...]
Note, selecting 'apache2-bin' for task 'lamp-server'
[...]
The following NEW packages will be installed:
[...]
0 upgraded, 37 newly installed, 0 to remove and 1 not upgraded.
Need to get 36,4 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n]
[...]
Again, we trimmed almost all the output because it was verbose. The next step is to figure out which tasks we can choose.
3.3. Ubuntu Tasks
tasksel –list-task doesn’t return the task list for Ubuntu 22.04. Instead, we got a list from earlier versions of Ubuntu. After that, we checked individually to see which tasks were available with the mentioned apt method. The following tasks are installable on Ubuntu 22.04 and Ubuntu-based distros, such as Linux Mint 21.1:
- ubuntustudio-dvd-live → Ubuntu Studio live DVD
- cloud-image → Ubuntu Cloud Image (instance)
- dns-server → DNS server
- kubuntu-desktop → Kubuntu desktop
- kubuntu-full → Kubuntu full
- lamp-server → LAMP server
- lubuntu-desktop → Lubuntu Desktop
- mail-server → Mail server
- postgresql-server → PostgreSQL database
- print-server → Print server
- samba-server → Samba file server
- ubuntu-desktop → Ubuntu desktop
- ubuntu-mate-core → Ubuntu MATE minimal
- ubuntu-mate-desktop → Ubuntu MATE desktop
- ubuntustudio-audio → Audio recording and editing suite
- ubuntustudio-desktop → Ubuntu Studio desktop
- ubuntustudio-desktop-core → Ubuntu Studio minimal DE installation
- ubuntustudio-fonts → Large selection of font packages
- ubuntustudio-graphics → 2D/3D creation and editing suite
- ubuntustudio-photography → Photograph touchup and editing suite
- ubuntustudio-publishing → Publishing applications
- ubuntustudio-video → Video creation and editing suite
- xubuntu-core → Xubuntu minimal installation
- xubuntu-desktop → Xubuntu desktop
- openssh-server → OpenSSH server
- server → Basic Ubuntu server
In contrast, these other tasks are installable on Ubuntu only:
- kubuntu-live → Kubuntu live CD
- ubuntu-budgie-live → Ubuntu Budgie live CD
- ubuntu-live → Ubuntu live CD
- ubuntu-mate-live → Ubuntu MATE Live CD
- xubuntu-live → Xubuntu live CD
- ubuntu-budgie-desktop → Ubuntu Budgie desktop
Note that this task list may change in later versions of Ubuntu.
5. Conclusion
In this article, we’ve seen how to use tasksel on Debian, Ubuntu, and derived distributions. It should be intuitive and straightforward, but Ubuntu 22.04 has introduced some difficulties. As seen here, there are some ways to get around them.