First refresh your package index…
$ sudo apt-get update
… and then install the LAMP stack:
$ sudo apt-get install lamp-server^
Mind the caret (^) at the end.
If occers: E: Unable to locate package lamp-server
Try to use:
sudo apt-get install tasksel
sudo tasksel install lamp-server
LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the virtual private server is already running Ubuntu, the linux part is taken care of.