Currently I have installed Kubuntu 18.04.2 and I want to switch to Ubuntu Mate (the same version) but I want to keep my programs installed. Is there a way to keep the programs that I have installed or do I have to format my HDD?
2 Answers
You don't have to reinstall to switch to Mate.
Simply do a
sudo apt install ubuntu-mate-desktop
This will install the Ubuntu Mate Desktop to your computer.
If you want to remove some packages that is needed by kubuntu-desktop, but not ubuntu-mate-desktop the following commands will take care of that:
apt-cache depends kubuntu-desktop | grep -E "(Depends|Recomends)" | cut -d ':' -f 2 | xargs sudo apt-mark auto
This sets all packages recomended by kubuntu-desktop to automatically installed, and thus harvestable by apt autoremove.
Next, set all packages needed for ubuntu-mate-desktop as manually installed, and run the uninstall:
apt-cache depends ubuntu-mate-desktop | grep -E "(Depends|Recomends)" | cut -d ':' -f 2 | xargs sudo apt-mark manual
sudo apt remove kubuntu-desktop
sudo apt autoremove
I have tested this, and it appears to have no ill effects. It doesn't uninstall that much since everything installed by the installer is marked as manually installed, but it removes some, and at least removes some manual flags.
The over all extra disk use from installing mate was pretty exactly 1GiB on a stock 18.04.2 install. If this is acceptable to you, you may keep both environments.
- 23,497
You can build a list of all the packages you have installed with the command:
sudo dpkg --get-selections > package.list
And to restore the packages use:
sudo dpkg --set-selections < package.list
sudo apt-get dselect-upgrade
- 23,497
- 3,704