Why does "tasksel" give an "aptitude failed" error?
This is a long outstanding bug.
Do
sudo apt-get update
then
sudo tasksel install lamp-server
Oh and if this ever happens when you (re)install MySQL itself make sure to remove /var/lib/mysql
.
edit: Found it on Launchpad from a report in 2007.
Nowadays you can also do
sudo apt-get install lamp-server^
The ^ is the equivalent of task select.
I know this thread isn't new and shiny and also this has already been answered but for those who encounter the issue again; I found that I received this error whilst trying to use tasksel to install whilst not having enough storage space left on my device. After removing some files and cleaning up the system of a little of junk, I tried again with success.
After clearing up I used:
apt-get -f install
As suggested by izx
After which, tasksel worked as usually expected.