How to completely remove elementary OS (Ubuntu 18.04)?

Solution 1:

It is bad idea do upgrade from LTS to non-LTS version. You will need to wait for 20.04 LTS with all possible stops as 19.04 and 19.10. Consider to stay on 18.04 LTS.

If you have added elementary by PPAs, then you can remove them with commands below:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:elementary-os/daily
sudo ppa-purge ppa:elementary-os/os-patches
sudo ppa-purge ppa:elementary-os/stable
sudo ppa-purge ppa:elementary-os/staging
sudo ppa-purge ppa:elementary-os/testing

then reinstall GNOME Shell with

sudo apt-get install ubuntu-desktop

As we have the output of dpkg -l | grep -i elementary then I can suggest two things:

1. Purge remaining packages with rc state (with remaining config files):

sudo apt-get purge $(dpkg -l | grep -i elementary | grep ^rc | awk '{print $2}')

2. Reinstall packages with elementary versions from current repositories:

sudo apt-get install --reinstall $(dpkg -l | grep -i elementary | grep ^ii | awk '{print $2}')