You need to use tasksel command. It is a software installation application that is an integral part of the Debian installer and works under Ubuntu Linux too. It groups some packages by tasks and offers the user an easy way to install the packages for that task. It provides the same functionality as using conventional meta-packages.
How do I use tasksel?
tasksel has been included as part of the base installation under both Debian and Ubuntu Linux (since Ubuntu Edgy). tasksel shows all available tasks and allows to user to select ones to install. Simply type tasksel as root user at a shell prompt:
$ sudo tasksel
You will see software selection menu as follows as per your distro version:
Select required group by pressing space bar followed by OK button.
How do I list available groups from a command prompt?
The option –list-tasks list on screen the tasks (packages) that would be displayed in the tasksel TUI (text user interface). You can use it as follows:
$ tasksel --list-tasks
u server Basic Ubuntu server u dns-server DNS server u edubuntu-server Edubuntu server i lamp-server LAMP server u mail-server Mail server i openssh-server OpenSSH server u postgresql-server PostgreSQL database i print-server Print server i samba-server Samba file server u tomcat-server Tomcat Java server u virt-host Virtual Machine host u ubuntustudio-graphics 2D/3D creation and editing suite u ubuntustudio-audio Audio creation and editing suite u edubuntu-desktop-kde Edubuntu KDE desktop u edubuntu-desktop-addon Edubuntu desktop u kubuntu-desktop Kubuntu desktop u ubuntustudio-audio-plugins LADSPA and DSSI audio plugins u mythbuntu-desktop Mythbuntu additional roles u mythbuntu-frontend Mythbuntu frontend u mythbuntu-backend-master Mythbuntu master backend u mythbuntu-backend-slave Mythbuntu slave backend u mobile-mid Ubuntu MID edition u ubuntustudio-desktop Ubuntu Studio desktop (must install) i ubuntu-desktop Ubuntu desktop u mobile-mobile Ubuntu mobile u ubuntustudio-video Video creation and editing suite u xubuntu-desktop Xubuntu desktop u edubuntu-live Edubuntu live CD u kubuntu-kde4-live Kubuntu live CD u kubuntu-live Kubuntu live CD u kubuntu-dvd-live Kubuntu live DVD u mythbuntu-live Mythbuntu live CD u ubuntu-live Ubuntu live CD u ubuntu-dvd-live Ubuntu live DVD u xubuntu-live Xubuntu live CD
The –task-desc task option displays the extended description of the given task:
$ tasksel --task-desc virt-host
Packages necessary to host virtual machines
How do I install package group (tasks) from a command line?
To install lamp-server type the following apt-get command:
$ sudo apt-get install lamp-server^
OR use the following apt command to install dns-server task:
$ sudo apt install dns-server^
Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python2.7-minimal' for task 'dns-server' Note, selecting 'libirs141' for task 'dns-server' Note, selecting 'python2.7' for task 'dns-server' Note, selecting 'bind9utils' for task 'dns-server' Note, selecting 'python' for task 'dns-server' Note, selecting 'libpython-stdlib' for task 'dns-server' Note, selecting 'bind9' for task 'dns-server' Note, selecting 'libpython2.7-minimal' for task 'dns-server' Note, selecting 'libpython2.7-stdlib' for task 'dns-server' Note, selecting 'python-minimal' for task 'dns-server' Note, selecting 'bind9-doc' for task 'dns-server' libpython-stdlib is already the newest version (2.7.11-1). libpython-stdlib set to manually installed. python is already the newest version (2.7.11-1). python set to manually installed. python-minimal is already the newest version (2.7.11-1). python-minimal set to manually installed. libpython2.7-minimal is already the newest version (2.7.12-1~16.04). libpython2.7-minimal set to manually installed. libpython2.7-stdlib is already the newest version (2.7.12-1~16.04). libpython2.7-stdlib set to manually installed. python2.7 is already the newest version (2.7.12-1~16.04). python2.7 set to manually installed. python2.7-minimal is already the newest version (2.7.12-1~16.04). python2.7-minimal set to manually installed. The following NEW packages will be installed: bind9 bind9-doc bind9utils libirs141 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 788 kB of archives. After this operation, 4,520 kB of additional disk space will be used. Do you want to continue? [Y/n]
And yes, you CANOT forgot the caret (^) symbol. You need to put ^ at the end of package name; otherwise it will give an error which read as follows:
E: Couldn't find package lamp-server
Read tasksel man page for more info: