Tasksel is a tool in Ubuntu, which helps to install multiple related packages used for specific tasks. This function is similar to that of meta-packages, and, in fact, most of the tasks available from tasksel are also available as meta-packages from the Ubuntu package managers (such as Synaptic Package Manager or KPackageKit). Basic Ubuntu server, OpenSSH server, DNS server, LAMP server, Mail server, Openstack, PostgreSQL database etc.
Install LAMP using Tasksel Command Line on Ubuntu
Tasksel package is available under default repositories on most of Ubuntu, Use the following command to install it.
# sudo apt-get install tasksel
Install LAMP using Tasksel
After installing tasksel, Now install LAMP setup on your Ubuntu using following command
$ sudo tasksel
Now select the LAMP server when installer will prompt like below and press OK.
During installation of MySQL Server by tasksel, It will prompt for MySQL root account password twice.
and your setup will be completed within few minutes.
Verify LAMP Server
Now create a phpinfo file info.php using following code.
# vim /var/www/html/info.php
Now access below URL in browser.