How do I completely uninstall LAMP Server and start fresh?

18,003

My preference is using apt/apt-get rather than tasksel.

Many times seems to fail for me + disallow simple customizations.

Destroying an entire LAMP Stack install can be a bit tricky.

You'll use apt-get purge $package to removed code + all config files.

Then use dpkg -l | grep $package to verify you've actually removed all traces of related packages.

Installing Apache-2.4.28 + PHP-5.6 covers how I install full lamp stacks for my hosting clients. Just change all occurrences of 5.6 to 7.1 to install latest PHP code.

Share:
18,003

Related videos on Youtube

bigdaveygeorge
Author by

bigdaveygeorge

Updated on September 18, 2022

Comments

  • bigdaveygeorge
    bigdaveygeorge over 1 year

    I am attempting to install LAMP server so I can work on PHP and MySQL databases locally on Ubuntu 16.04LTS.

    I got through a lot of the installation and then decided I wanted to start again (see below as to why). How can I remove everything associated with LAMP server that I have just installed and start again?

    I went through the following steps when installing:

    sudo apt-get install tasksel
    

    and then

    sudo tasksel install lamp-server
    

    Upon going though these steps it asked me for a mysql password, which I (probably shouldn't have) left blank.

    I then installed phpmyadmin, again leaving the password blank for root.

    After installation of phpmyadmin I then had to use

    sudo gedit /etc/apache2/apache2.conf
    

    And add this line:

    Include /etc/phpmyadmin/apache.conf
    

    Attempting to login to phpmyadmin threw up an error about removing the 'allownopasswords' or setting similar to that to allow me to enter with no pass.

    At this point I decided to completely reinstall and use a password.

    So I attempting to remove the packages I had used using some commands found here: How do I remove the LAMP stack so I can start over? & How do I remove the LAMP stack so I can start over?

    I then reinstalled lamp-server, this time it showed no password entry and then I installed phpmyadmin.

    Now when I goto localhost/phpmyadmin it just displays the config file, as if PHP is not installed.

    I assume I am now missing some vital parts of the server.

    I want to completely start afresh and install LAMP from scratch, how can I do this?

    It would also be useful to know what the different passwords are for mySQL that it requests on installation, is it just 1 root user and password?

    Thanks,

    • Rinzwind
      Rinzwind over 6 years
      You can skip the "tasksel" part if you use sudo tasksel install lamp-server^ (the ^ makes it connect to the task)
    • bigdaveygeorge
      bigdaveygeorge over 6 years
      Thanks, but how can I remove everything already installed the first time and start again?
    • steeldriver
      steeldriver over 6 years
    • Rinzwind
      Rinzwind over 6 years
      See that one ^ and re-install will not fix your issue ;-) I would ask about the problem you have and fix THAT. Learn from the problem.
    • bigdaveygeorge
      bigdaveygeorge over 6 years
      I am looking for an answer on how to remove everything I have just installed. Surely if I have installed lamp-server this is made up of various packages that I can remove, but how do I know what they are? This is a question I find myself asking myself a lot when installing and wanting to remove software in Ubuntu.