3

I am currently running KDE Neon which is based on Ubuntu 20.04 but I would like to attempt to go back to "normal" Ubuntu.

I have a separate /home partition but I have various manual installs in /opt, changes to grub, startup scripts etc so I don't really want to do a backup and fresh install.

Is there anything wrong with the following?

Remove the neon packages:

sudo apt remove 'neon-*'

Remove the neon repos from apt:

 sudo find /etc/apt/sources.list.d -name "neon*" -exec rm {} \;

Then update and install an ubuntu desktop:

sudo apt update
sudu apt install kubuntu-desktop
opticyclic
  • 701
  • 6
  • 24

2 Answers2

2

TL;DR It is possible, but very difficult.

The method below is presented without any warranty. Use it on your own risk.

Initial state

What we have on freshly installed neon-user-20200910-0945.iso system:

$ grep ^deb -r /etc/apt/ --include=*.list
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
/etc/apt/sources.list.d/preinstalled-pool.list:deb [arch=amd64] file:/var/lib/preinstalled-pool/ focal main restricted universe multiverse
/etc/apt/sources.list.d/neon.list:deb http://archive.neon.kde.org/user focal main
/etc/apt/sources.list.d/neon.list:deb-src http://archive.neon.kde.org/user focal main

So it is based on Ubuntu 20.04 LTS (focal) with some extra packages.

We can follow and adapt my method for transforming LinuxMint to Ubuntu.

Conversion KDE Neon → Kubuntu Focal Fossa 20.04 LTS

Case of freshly installed KDE Neon

Let's create script for listing of packages from known repository:

cat > find_origin.sh << \EOF
LC_ALL=C dpkg-query --showformat='${Package}:${Status}\n' -W '*' | \
fgrep ':install ok installed' | cut -d: -f1 | \
(while read pkg; do inst_version=$(apt-cache policy $pkg \
| fgrep Installed: \
| awk '{ print $2 }'); origin=$(apt-cache policy "$pkg" \
| fgrep " *** ${inst_version}" -C1 \
| tail -n 1 \
| cut -c12-); echo $pkg $origin; done)
EOF

Find Neon packages and remove them:

sh find_origin.sh | grep neon.kde.org > ~/neon-packages-all.txt

cat neon-packages-all.txt | grep -v "E:" | grep -v ^base-files > ~/neon-packages-remove.txt

sudo sed -i "s/deb/#deb/g" /etc/apt/sources.list.d/neon.list /etc/apt/sources.list.d/preinstalled-pool.list sudo apt-get update

sudo apt-get install aptitude sudo aptitude purge $(cat ~/neon-packages-remove.txt | awk '{print $1}')

Launch Aptitude with sudo aptitude.
Set all packages from Obsolete and Locally Created Packages section to purge.

Check locally installed packages with:

sh find_origin.sh | grep /var

Reinstall one (maybe more!) package listed here - base-files from focal-updates:

sudo apt-get install base-files=11ubuntu5.2 --reinstall

Then purge all packages that does not have ii state (such as rc) with:

sudo apt-get purge $(dpkg -l | grep -v ^ii | tail -n +6 | awk '{print $2}')
sudo apt-get install linux-image-generic linux-headers-generic
sudo locale-gen en_US.UTF-8

And finally install Kubuntu desktop:

sudo apt-get install kubuntu-desktop^ kde-full

Reboot and have nearly normal Kubuntu Focal 20.04 LTS :)

Case of KDE Neon with removed neon.list file

At first we need to list all packages with neon in name or version:

dpkg -l | grep neon > ~/neon-packages.txt

sudo aptitude purge $(cat ~/neon-packages.txt | awk '{print $2}')

Reinstall single package with

sudo apt-get install base-files=11ubuntu5.2 --reinstall

Install KDE and Kubuntu stuff with

sudo apt-get install kubuntu-desktop^ kde-full $(cat ~/neon-packages.txt | awk '{print $2}' | grep -vE "docker-neon|libkaccounts2:amd64|libkdsoap-common|libkdsoap1:amd64|libksgrd9:amd64|libksignalplotter9:amd64|libksysguardformatter1:amd64|libksysguardsensorfaces1:amd64|libksysguardsensors1:amd64|libkwaylandserver5:amd64|libprocesscore9:amd64|libprocessui9:amd64|libqt5qmlmodels5:amd64|libqt5qmlworkerscript5:amd64|neon-adwaita|neon-apport|neon-desktop|neon-hardware-integration|neon-keyring|neon-settings-2|neon-ubuntu-advantage-tools|okular-backends|qml-module-org-kde-ksysguard:amd64")

Reboot and have nearly normal Kubuntu Focal 20.04 LTS :)

N0rbert
  • 99,918
-1

No, you cannot convert KDE Neon to Ubuntu.

KDE Neon is an entirely different Linux distribution with different repositories.

FYI: The default flavor of Ubuntu uses the GNOME3 desktop. If you want to use Ubuntu with KDE, you can install Kubuntu, which is an official flavor of Ubuntu.

Nmath
  • 12,333
  • While you might be right about converting KDE Neon to Ubuntu, KDE Neon is actually the Ubuntu base with the latest KDE packages. So a sort of Kubuntu with rolling KDE (but stable LTS base). – fcole90 Jul 23 '21 at 08:49
  • 1
    @fcole90 the amount of time and tediousness required to ham-fist converting one distro to another distro is not worth the effort. There are tons of distros based on Ubuntu that don't use the same repos and are so significantly different that it is effectively not feasible to do this. Trying to change desktop environments on an installed system is enough of a pain: this is why Ubuntu has several flavors including Kubuntu. But even Kubuntu is not KDE Neon even though they are similar. – Nmath Jul 23 '21 at 09:05
  • indeed, my point was only about your statement "KDE Neon is an entirely different Linux distribution". Then, I agree that converting from plain Ubuntu or even Kubuntu might be too painful and troublesome that it's not worth the effort nor the risk. – fcole90 Aug 01 '21 at 09:29