How to remove lubuntu-desktop from Ubuntu 14.04 LTS

I have installed lubuntu-desktop in my Ubuntu 14.04 LTS. Now I want to get pure Ubuntu. How can I revert back to Ubuntu only ?

Note: I have searched in the google and found solutions for 12.04 / 12.10. But have not found any solution for Ubuntu 14.04 LTS yet. Thats why I asked here.


I had the same issue and solve it following the steps in the next link: How to completely uninstall/remove a package/software/program.

That helped me removing all and only the dependencies/packages that were installed with the sudo apt-get install lubuntu-desktop command.

Edit:

I'll try to guide you better.

First of all, if you followed @Saurav instructions, I'd recommend to install lubuntu-desktop again so we make sure all deleted packages are in your system.

When I used the previous command, a bunch of new packages/programs were to be installed along. To show a few:

terminal screenshot

and the list goes on...

To get rid of all these, you should use

sudo apt-get remove --auto-remove abiword abiword-common ... etc

listing every package installed. To do so, we are gonna find all these packages in the history.log file, which keeps a record of all APT installations, upgrades or removals. Open the log file with the following:

gedit /var/log/apt/history.log

Here, use Ctrl+F to search the term "lubuntu-desktop" and you should see something like this:

history.log in-search

Note: If you don't find the command here, as it happened to me, the log file has been rotated. Go to /var/log/apt/ with nautilus /var/log/apt/, double-click history.log.1.gz and open history.log.1 (look the name of the gedit tab in the previous image).

Now, select all the packages until the "End-Date: 2014 ..." line, copy and paste them in a new gedit file. As you can see, these packages are in the form "package_name:i386 (something between parenthesis)". Note that "i386" could be "amd64" depending on your OS. Now, from what we've got, only the package name is important. To remove the extra stuff, press Ctrl+H to invoke the find & replace tool. In the Search for input field, type (again, depending on your OS):

:i386 \([0-9\:\~\.\+a-zA-Z\-, ]*\),?

:amd64 \([0-9\:\~\.\+a-zA-Z\-, ]*\),?

Leave the Replace with field blank, check coincide regular expression and press Replace all.

Find and Replace

Now, you have the list of installed packages separated by space, so copy them, open up your terminal and type:

sudo apt-get remove --auto-remove *paste packages*

And that's it. You have completely removed lubuntu-desktop

Regards,


Execute these commands:

sudo apt-get autoremove lxde
sudo apt-get autoremove lubuntu-desktop
sudo apt-get --purge remove lxde
sudo apt-get --purge remove lubuntu-desktop

Note: it would be possible that lubuntu-desktop packages may not be installed.

Also execute this command to get the packages of lubuntu-desktop:

whereis lxde

You would get the path like /usr/share/lxde

Remove the directory /usr/share/lxde completely by:

sudo rm -rf /usr/share/lxde

Since I mentioned the commands in one line that would be the problem. Try it once. I'm also listing my output of the first command:

sk@sk-Vostro-1015:~/.config/openbox$ sudo apt-get autoremove lxde
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  galculator giblib1 leafpad libxmmsclient-glib1 libxmmsclient6 lxappearance lxde lxinput lxmusic lxrandr lxsession-edit menu-xdg scrot xmms2-core
  xmms2-plugin-alsa xmms2-plugin-id3v2 xmms2-plugin-mad xmms2-plugin-vorbis
0 upgraded, 0 newly installed, 18 to remove and 56 not upgraded.
After this operation, 7,384 kB disk space will be freed.
Do you want to continue [Y/n]? 

Reply if you get any problem :)