3

Ubuntu is great and thus I installed it in my father's computer. But the computer is quite old and Ubuntu was becoming slower after every upgrade (now it's on version 18.04 LTS). Thus I installed Lubuntu on top of it. Now he just uses Lubuntu and he's quite happy about it.

How can Ubuntu be removed from a computer which has both Ubuntu and Lubuntu? They are both in the same partition.

  • 1
    Did you installed both in same partition or different partitions? – MOHSIN SHAHZAD Dec 25 '20 at 20:44
  • You'll need to clarify "on top of it". To me that implies you've just run sudo apt install lubuntu-desktop and added the Lubuntu desktop to your existing machine, and you want to just remove the GNOME/Ubuntu desktop options at login. It however could also mean you've a dual boot system, and you're asking how to remove the second installed OS; currently it's unclear. What do you mean by "on top of it"? (those two options have very different fixes) – guiverc Dec 25 '20 at 21:13
  • 1
    My workstation was an initial Ubuntu Desktop install; I added ubuntu-mate-desktop, xubuntu-desktop and lubuntu-desktop. I recently needed disk space, and decide a quick fix was to remove ubuntu-mate-desktop (my least used) so for me it was just a sudo apt remove ubuntu-mate-desktop. I of course read the packages that were going to be removed; saw no negative consequences (but would have corrected any if there) & it ran. My MATE/Ubuntu-MATE option is now gone. Is this what you mean? – guiverc Dec 25 '20 at 21:16
  • Also asked at https://discourse.lubuntu.me/t/how-to-remove-ubuntu-and-keep-lubuntu/1984/3 – guiverc Dec 25 '20 at 21:42
  • @guiverc yes, exactly, they are both in the same partition and I ran sudo apt install lubuntu-desktop – João Pimentel Ferreira Dec 25 '20 at 21:56
  • My suggestion is found at https://discourse.lubuntu.me/t/how-to-remove-ubuntu-and-keep-lubuntu/1984/4 (it's just an explanation of my prior comment anyway, with clues on how I'd test it & correct any issues) – guiverc Dec 25 '20 at 23:36
  • So it is just the ubuntu-desktop you don't want. Uninstall that then – Thorbjørn Ravn Andersen Dec 26 '20 at 09:01
  • @guiverc can you make you answer as a separate answer such that I can mark it as the solution? – João Pimentel Ferreira Dec 26 '20 at 09:36
  • 1
    A sudo apt remove ubuntu-desktop will just remove a tiny metapackage designed to pull in all packages deemed essential for the desktop. Even a sudo apt autoremove afterwards will not remove most of the actual packages. Without a list if actually installed packages, you cannot automatically remove an installed desktop granularity. – vanadium Dec 26 '20 at 10:11
  • @vanadium can you be more precise and tell me which packages should I further remove? – João Pimentel Ferreira Dec 26 '20 at 11:36
  • I don't have that list. If you are happy with the answer you accepted, for all means go with it. In my opinion, that removes nothing but a small metapackage. – vanadium Dec 26 '20 at 14:06

2 Answers2

5

You can try this

Start in text-only mode

Switch on your computer. Wait until the BIOS has finished loading, and press and hold Shift, which will bring up the Grub menu.
Select the line which starts with Advanced options.
Select the line ending with (recovery mode)
Press Return and your machine will begin the boot process.
After a few moments, your PC should display a menu with a number of options, including Drop to root shell prompt. Press Return with this option highlighted.
The PC will start in a terminal.

Run these commands:

Mount partitions in read-write mode

mount -o remount,rw /
mount --all

Update repositories

apt-get update

Install aptitude and deborphan

apt-get install --reinstall aptitude deborphan

Eliminate the components of gnome that are not necessary in lubuntu

aptitude remove '?and(?reverse-depends(gnome),?not(?reverse-depends(?exact-name(lubuntu-desktop))))'

Reinstall lubuntu-desktop

apt-get install --reinstall lubuntu-desktop

Eliminate orphan packages

deborphan
apt-get --purge remove $(deborphan)
deborphan --libdevel
apt-get --purge remove $(deborphan --libdevel)
deborphan --find-config
dpkg --purge $(deborphan --find-config)

Remove unnecessary packages

apt-get autoremove

Remove downloaded packages

apt-get clean

Restart system

reboot
kyodake
  • 15,401
2

As I alluded to on Ask Ubuntu, I would expect a simple

sudo apt remove ubuntu-desktop

To do what you want. I haven't done that recently on a 18.04 Ubuntu base install with another desktop added, so without testing I can't be sure if any problems are to be expected. I wouldn't expect any (results may differ depending on changes you've made however).

As I also stated on Ask Ubuntu I'd type the command and scan the output of packages to be removed looking for any potential problems (not expecting any, but better safe than sorry), then proceed. If I noted any, I'd fix them by a sudo apt install either before the ubuntu-desktop removal (which will cause package(s) to be marked as manually installed; thus they'll remain), OR after it (same end effect, after the remove it may require the package to be re-downloaded being the difference; tiny bandwidth hit)

For years all my installs were Ubuntu desktop, with my wanted desktop added later as my ISP allowed bandwidth quota free download of Ubuntu ISOs only, updated packages were also quota free so adding lubuntu-desktop (etc) afterwards used none of my monthly bandwidth quota. They no longer offer this so I no longer do it this way.

If you're worried about the effect, I'd install Ubuntu Desktop on a VM, apt install lubuntu-desktop, reboot the VM, then do the sudo apt remove lubuntu-desktop, restart the VM and look for ill effects; I wouldn't expect any, but currently I'm unwilling to do that test.

this answer was written first on discourse.ubuntu.com, thus the references to this site in my wording

guiverc
  • 30,396
  • ps: I didn't mention sudo apt autoremove to remove previously installed dependencies that are no longer required (related to the GNOME desktop); I run it daily anyway (I use hirsute or the development release), so I didn't think of it sorry. – guiverc Dec 26 '20 at 11:42
  • Removing merely the metapackage for the desktop environment will not remove the desktop, even if you have it followed by an autoremove. – vanadium Dec 26 '20 at 14:04
  • It'll leave behind some configs etc, but I don't see that as an issue (neither the plymouth screen I see as wallpaper (of no importance, though yeah I know users here raise questions about it being left behind quite often). The apt remove ubuntu-mate-desktop removed MATE programs on my box. – guiverc Dec 26 '20 at 21:20