Remove/re-install LAMP with current versions on Ubuntu 18.04

19,042

You can remove all the main stuff with these commands:

sudo apt-get purge mysql-server apache2 php
sudo apt autoremove && sudo apt autoclean

Then reinstall it the modern way using taskel:

sudo apt install tasksel
sudo tasksel install lamp-server
Share:
19,042
yourpalfranc
Author by

yourpalfranc

Updated on September 18, 2022

Comments

  • yourpalfranc
    yourpalfranc over 1 year

    I'm having trouble with my LAMP stack since the Ubuntu 18.04 upgrade, so I'd like to just remove everything and start with a clean slate. I'm referring to the post entitled "How do I remove the LAMP stack so I can start over?" but, it appears to list older versions, PHP5 for example. I can't find documentation for anything more current and I have PHP 7.2.7 installed. Can I just substitute PHP7 in every instance of PHP5 and accomplish the same results, or is there more current and specific documentation that I haven't found. Thanks, in advance, for your assistance.

    • Joshua Besneatte
      Joshua Besneatte over 5 years
      using an old guide and replacing php7 where neccessary should work for removing. once you have removed your lamp stack, install it following this guide: linuxconfig.org/…
    • Joshua Besneatte
      Joshua Besneatte over 5 years
      posted it to an answer.... you might just use php instead of php7
  • yourpalfranc
    yourpalfranc over 5 years
    OK. I was able to get back to this and follow your instructions. After the installation I rebooted the PC, and tried an Apache2 test with localhost/index.html. That looked fine. The PHP version showed 7.2.something. The one question I had was that when I logged into MySQL it accepted my OLD user/pass. Is that normal?? I was prepared complete install to be purged and to start over. Thanks for the steps.
  • tgkprog
    tgkprog almost 5 years
    What does it install, Mysql or MariaDb ? help.ubuntu.com/community/Tasksel#Task_descriptions says nothing much