Uninstalling Gnome on Kubuntu
Be careful when uninstalling gnome on Kubuntu. Just a warning.

By. Jacob
Edited: 2019-09-28 15:27
Recently I attempted to uninstall Gnome Desktop on a system running Kubuntu, since I was never using it, and probably just installed it for testing something. It did not go that well, however.
I simply made the logical assumption that I could safely remove everything that had "gnome" in its name, and that would surely get rid of the login option, as well as save me some hard disk space. This was true. But it also uninstalled Firefox, Thunderbird and even Google Chrome, Visual Studio Code and the Nemo file manager!
The problem is, it is very hard to know what every single package is, and all of their related dependencies. It seemed easier to just uninstall everything rather than look up each and every package. So, I first ran the following command to get a list of Gnome packages on the system:
dpkg --get-selections | grep gnome
This resulted in a huge list of packages. I got rid of the spaces and "install" part with a simple regular expression search and replace, and then I pasted everything into the terminal, packages only separated by space:
sudo apt remove --purge [package1 package2 package3 ...]
Did I panic when my icons disappeared and I started getting "language support is incomplete" notifications? Not really. I have been here before.
Instead of panicking I made another logical assumption, that whatever I removed, could probably be easily re-installed. Luckily I was right.
These are all applications I regularly use, so I simply re-installed the packages I needed one by one, until everything was back to normal. Now, when I run the same search command for installed Gnome packages, all I get is this:
language-pack-gnome-en install
language-pack-gnome-en-base install
libgnomekbd-common install
libgnomekbd8:amd64 install
libsoup-gnome2.4-1:amd64 install
This is far, far less than before uninstalling. The point is, do not just assume things are not needed, because some things seem to be interlinked, and you will risk uninstalling things you need and/or breaking your system. It is probably better to backup your things and do a clean install.
I also ran this, just to be safe:
sudo apt install --reinstall kubuntu-desktop kubuntu-restricted-extras
Initially I was fearing that I would have lost all my settings as well, and my open project files in Visual Studio Code, but none of this was lost. Even my Profiles in Google Chrome was still there after I re-installed chrome.
Tell us what you think: