There are multiple ways of installing software on Debian based systems like Ubuntu and Mint. Tools like apt, apt-get, aptitude and/or synaptic are usually used to install single applications into the desktop editions of those OS. Alternatively, Tasksel is a command line app for installing a “group” of related packages onto a server. Tasksel is not installed by default on the desktop editions of the ‘nix’ versions that contain the above-mentioned package managers but, it is installed on later versions of Debian and Ubuntu server editions.
How Does Tasksel Work?
Tasksel uses meta-packages to pull a ‘virtual group’ of software apps and dependencies together to install a software bundle defined by a configuration (or .cfg) file. Metapackages themselves do not contain the actual applications, they simply reference a group of packages together as seen here. In this case, this is a reference to a software install for ubuntu-server.
Initially, we want to make sure our Ubuntu server is up to date with the latest software:
root@test:~# apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] Fetched 323 kB in 0s (1,019 kB/s)
Reading package lists... Done
Is Tasksel Already Installed?
To verify if Tasksel is already installed, run:
root@test:~# which tasksel
If Tasksel is not installed, install it from the command-line:
root@test:~# apt-get install tasksel
Error Running Tasksel?
After installing, if by chance you get an error similar to:
root@test:~# taskselSimply run:
tasksel: apt-get failed (100)
root@test:~# dpkg --configure -aThat should correct that error message.
What Can I Install With Tasksel?
To see a list of all the packages available to install, use the “–list-tasks” flag with the Tasksel command:
root@test:~# tasksel --list-tasks
u manual Manual package selection
u kubuntu-live Kubuntu live CD
u lubuntu-live Lubuntu live CD
u ubuntu-gnome-live Ubuntu GNOME live CD
u ubuntu-live Ubuntu live CD
u ubuntu-mate-live Ubuntu MATE Live CD
u ubuntustudio-dvd-live Ubuntu Studio live DVD
u ubuntustudio-live Ubuntu Studio live CD
u xubuntu-live Xubuntu live CD
u cloud-image Ubuntu Cloud Image (instance)
u dns-server DNS server
u edubuntu-desktop-gnome Edubuntu desktop
u kubuntu-desktop Kubuntu desktop
u kubuntu-full Kubuntu full
u lamp-server LAMP server
u lubuntu-core Lubuntu minimal installation
u lubuntu-desktop Lubuntu Desktop
u mail-server Mail server
u mythbuntu-backend-master Mythbuntu master backend
u mythbuntu-backend-slave Mythbuntu slave backend
u mythbuntu-desktop Mythbuntu additional roles
u mythbuntu-frontend Mythbuntu frontend
u postgresql-server PostgreSQL database
u samba-server Samba file server
u tomcat-server Tomcat Java server
u ubuntu-desktop Ubuntu desktop
u ubuntu-gnome-desktop Ubuntu GNOME desktop
u ubuntu-mate-cloudtop Ubuntu MATE cloudtop
u ubuntu-mate-core Ubuntu MATE minimal installation
u ubuntu-mate-desktop Ubuntu MATE desktop
u ubuntu-usb Ubuntu desktop USB
u ubuntustudio-audio Audio recording and editing suite
u ubuntustudio-desktop Ubuntu Studio desktop
u ubuntustudio-desktop-core Ubuntu Studio minimal DE installation
u ubuntustudio-font-meta Large selection of font packages
u ubuntustudio-graphics 2D/3D creation and editing suite
u ubuntustudio-photography Photograph touchup and editing suite
u ubuntustudio-publishing Publishing applications
u ubuntustudio-video Video creation and editing suite
u virt-host Virtual Machine host
u xubuntu-core Xubuntu minimal installation
u xubuntu-desktop Xubuntu desktop
i openssh-server OpenSSH server
i server Basic Ubuntu server
Now, let’s move on to installing the LAMP stack!
What Is The LAMP Stack?
The LAMP stack is the basis for running one of the most stable and time-tested server platforms for hosting websites. LAMP is an acronym for the Linux, Apache, MySQL and PHP software stack.
- Linux: The operating system
- Apache: The web server software
- MySQL: The database server software
- PHP: The programming language the sites are coded in
Instead of having to install all of those software packages separately, Tasksel offers a handy way to get a LAMP stack up and running very quickly.
How Do I Install A LAMP Server Using Tasksel?
To install a LAMP server, SSH into your new Ubuntu 16.04 server and open the terminal. At the terminals prompt, enter the following command:
This will open up the Software Selection menu where you can choose the software group you would like to install. In this case, we’re going to install LAMP.
Simply scroll down the menu using your keyboards arrow keys until you see the LAMP server option:
Select this group by hitting the spacebar on your keyboard. Next, hit the ‘tab’ key and click the “<OK>” button.
Next, Tasksel will begin installing the server’s software.
At a midpoint during the install, you will be asked to supply a MySQL password, twice. (Make sure you use a secure password!!!)
Add the same password again. Next, click the ‘ok’ button to continue the install.
After that, the install will continue to run…
When the install reaches 100%, it will drop you back to the bash prompt. You can verify that Tasksel installed the LAMP stack successfully by running the following command:
root@test:~# tasksel --list-tasks |grep "lamp-server"
i lamp-server LAMP server
Verify Apache is Installed
To verify that Apache was installed, simply open a browser window and type in the IP address of the server (Example: http://22.214.171.124/ ). You should see a page similar to this:
Verify PHP is Installed
To get further details about the install, let’s create a phpinfo.php page.
root@test:~# touch /var/www/html/phpinfo.php
Now, open the file using the “vi” command.
root@test:~# vi /var/www/html/phpinfo.php
Next, add this small snippet of code to the phpinfo.php file. Click the ‘insert’ button to edit the file then paste it into the file.
<?phpOnce the code has been added to the file, save the file using the “:wq” command.
// Show all information. This page defaults to INFO_ALL
Now, open your browser and type in the IP address of the server, followed by the phpinfo.php page like so: http://126.96.36.199/phpinfo.php
You should see a PHP page similar to the following:
Install Other Services With Ease
If needed, you can install other multiple services like Tomcat, mail server, OpenSSH or a DNS server by using these Tasksel commands:
root@test2:~# tasksel install tomcat
root@test2:~# tasksel install mail-server
root@test2:~# tasksel install dns-server
root@test2:~# tasksel install openssh-server
How can we help?
Thanks for taking the time to read up on the benefits of using Tasksel. Our Support Team is full of talented System Admins who have an intimate knowledge of web hosting technologies like those discussed in this article. If you are unsure about any of the steps outlined above, we are just a phone call, chat or ticket away from providing further information. Let us know what you think!