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 :)