Score:1

Safe way to remove DEs

mx flag

To test and learn I've installed several DEs Plasma, Ubuntu Gnome etc.

Other times, after removing one of them, many packages disappear and the remaining DEs are left almost unusable.

Is there a safe way to remove DEs?

user535733 avatar
cn flag
DEs --even the ones using Deb packaging-- are not really designed to be removable and replaceable. The pain points move around: Currently they are Plymouth and the Display Manager(s). The interaction between so many projects makes for complex beasts, and *uninstalling* is not a common DE developer use case. The testers I know tend to clean-install to change DEs.
guiverc avatar
cn flag
What you're asking is release specific; so IF you find an answer for a release, it may **not** apply to other releases so check the *depends* rules yourself to ensure the two releases are the same, as they do change. I'm a lover of multiple DEs & add/remove desktops somewhat regularly (*its not common behavior, but I'll do it multiple times per cycle, which is more than most I suspect*) but I'd not write an answer for the question as any answer will be release specific. It'll also depend how much you *manually installed* and how installed (ie. via meta package or not) & other factors too
guiverc avatar
cn flag
Yes it is safe, but I do homework before I remove a desktop. I look at what I actually installed (what meta packages I used hopefully; if I had any problems & left *mines* for myself by flipping packages to *manually installed* (eg. used `apt install -reinstall` will cause that package to be *manually installed* even if it was dragged in by meta package which will cause part of the DE to be left behind etc). It's details like this I explore before I run the `apt remove` command.. Even then I read the output before I say "y" to it; as I may have missed stuff, but am I seeing what I expected...
Minsky avatar
mx flag
Thank you @guiverc, i just thought I was doing something wrong. I am not experienced and installing+removing is how I was trying to learn. I'd be nice if you add an answer, just include what's on the comments maybe.
Minsky avatar
mx flag
@user535733 thank you for that! also invited to add an answer, as there are many things there I've neveer heard of and you may expand. Like what is plymouth besides a city in the UK.
Score:2
cn flag

Yes it is safe (my opinion; please read the final caveat at the bottom though!), but I do homework before I remove a desktop.

I'm a lover of multiple DEs & add/remove desktops somewhat regularly (its not common behavior, but I'll do it multiple times usually per six monthly release cycle, which is more than most I suspect) but I'd not write an generic answer for the question as any answer will be release specific.

It'll also depend how much you manually installed and how the desktop was installed (ie. via what meta package) & other factors too. In recent years I stopped adding the desktop (say the xfce meta package & switched to xubuntu-desktop which installs more, but I subjectively had less issues on removal)

I look at

  • what I actually installed (what *meta packages I used)
  • if I had any problems & left mines for myself by flipping packages to manually installed (eg. used apt install -reinstall will cause that package to be treated as manually installed even if it was dragged in by meta package initially; these can cause parts of the DE to be left behind on removal
  • etc

It's details like this I explore before I run the apt remove command. Even then I read the output before I say "y" to it; as I may have missed stuff, also did it report packages were being removed that I expected to be removed; if it doesn't look right I say "n" & explore why.

Note: historically my ISP let me download Ubuntu ISOs quota free; but not flavors; and upgrades & additional package installs were likewise quota free; thus I always installed a Ubuntu Desktop system, and installed/removed desktops as this was quota free; unlike downloading a flavor ISO which used quota..

This explanation isn't likely very easy, but I'm having trouble describing what I look for as I only really scan the output & come up with a feeling that's either "looks good", "something's missing", "not sure", or "no way - wrong!".

Either way I do on occasion have a less than perfect result (ie. "oops; missed that" moment) but within a minute or two I've worked out what was wrong & corrected it, and usually a logout/login proves it; or at worst a restart of the DM or reboot & it's golden again :)

ps: it's not a NEWBIE thing; but in my opinion, it's a great way to learn, as I learnt heaps from doing it, esp. fixing the occasional mess I'd make doing it !

guiverc avatar
cn flag
I'm using `xubuntu-desktop` as an example (even though I'm on other *flavor* teams..) as I do really like Xfce... As stated, my installs were always Ubuntu Desktop, thus was either GNOME (2), Unity (7), or GNOME (3) where I started.. thus it was the most common I'd remove. though I tended to avoid removing it unless I had to (I find 3 desktops are pretty easy to have co-exist; issues occurring most when on the 4th desktop install... getting to five is **rare**!) Removing the default GNOME/Unity I found the most problematic; but constant install/remove does get messy with problems
Minsky avatar
mx flag
i'll come back to it, but it is very interesting, and I'd never thought it was kinda complex. Still I will find a way to try without being scared.
guiverc avatar
cn flag
FYI: I didn't explain *homework* very well.. you can search online using packages.ubuntu.com (eg. https://packages.ubuntu.com/jammy/xubuntu-core or https://packages.ubuntu.com/jammy/xubuntu-desktop etc) and `apt-cache depends xubuntu-desktop` to see your current release (*I had to pick a release; so I've used my current jammy*). I'd look at what I currently had installed; and what I was going to install/remove; quick scan looking for clashes (ie. what maybe problem on install; or shouldn't be removed if that's what I want), or to give me a guide on what **I should see installed/removed etc**
guiverc avatar
cn flag
When I started I used to study (do more homework) of the packages (packages.ubuntu.com pages or `apt-cache depends` type enquiries) more than I do now, these days it's just a scan, as I don't expect problems OR if I have a problem because I scanned too quickly; I believe I can fix anything super quick. I have *test boxes* I'd likely use if I wanted to experiment (I'm involved in QA-testing; did 3 installs today - so I have systems I can *play* if I think necessary), but that would be rare.. At last resort; a re-install is super fast and can be done without losing data or your configs anyway
Score:-1
mx flag

You can remove desktop environments by running the command sudo apt remove $packagename. Replace $packagename with the name of your desktop environment.

KDE Plasma DE name: kde-plasma-desktop GNOME DE name: gnome-desktop

This is relatively safe. However, removing gnome-desktop could also remove GDM3 and various other proprietary (and important) resources. I do not recommend removing gnome-desktop, because that is what Ubuntu uses by default. Removing this could also remove the package gnome-software. My memory regarding this could also be flawed, and will not delete anything. When removing this DE, make sure that it does not want to remove any other packages. For more information regarding GNOME deletion, see How can I remove Gnome Desktop Environment without messing Unity DE? (Ubuntu 16.04)

NOTE: I'm sorry, but GNOME Desktop is either ubuntu-gnome-desktop or gnome-desktop

I had to re-post this...

ChanganAuto avatar
us flag
Better not re-post because this is wrong: Removing the meta-package does NOT remove the DE, including all the packages that were installed with/for it. Please read carefully the comments under the question. Both commenters have large experience in development and testing.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.