The easiest way to install LAMP on your Ubuntu 16.04/17.04 Desktop is by using Tasksel. Now, the first question which pops in your mind is, What the heck is Tasksel, and why should I use it ??
Let me tell you, according to Ubuntu Community wiki, Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system. Basically Tasksel is an utility in Ubuntu, which installs multiple related packages at once which otherwise needs individual installation. This article is intended to help you to use tasksel to install LAMP server on your Ubuntu Desktop.
Tasksel is not installed on Ubuntu Desktop edition by default. To install tasksel, use the following commond.
sudo apt-get install tasksel -y
Installing LAMP using Tasksel
To install LAMP, run Tasksel commond with sudo.
In the next window, you will see the list of available packages which you can install, use the arrow keys to go to LAMP server and spacebar to select the option, click on tab to move the cursor to ok and press enter to begin the installation.
During the process, it will prompt for mysql password twice, enter desired password and press enter. Once the installation is complete, it will go back to normal terminal.
To check if everything works alright, open a web browser, and open localhost, you will see a screen like this, which means LAMP is installed and working on your computer.