Purpose of this script
This is a little helper script for Kubuntu™ users who want to get rid of and block Snap entirely (like Linux Mint and TUXEDO OS do), including the Firefox Snap in 22.04 LTS & later and e.g. the Thunderbird and Firmware Updater Snaps in 24.04 LTS.
It has been tested many times with Kubuntu™ 20.04 LTS up to 24.04 LTS.
I hope you find the script useful! Yours respectfully, Schwarzer Kater
Installation and usage of this script
Important You will be asked twice for confirmation before the removal of Snaps and snapd is started and/or APT pinning to block future installation of Snap is applied - and if you answer "n" or "N" no changes at all are made to your system.
For some more information about what is done in detail see the comments within the script itself.
Known issues / bugs
Additional tips
⦁ After removing the Firmware Updater Snap in Kubuntu™ 24.04 LTS one can still manage firmware with the Discover software center or use the command fwupdmgr (see fwupdmgr --help) in the Konsole terminal emulator.
If you want to have a separate graphical program you can additionally install the GNOME Firmware Flatpak.
⦁ Flatpak is a good alternative (and IMHO better suited for desktop usage than Snap) if you have removed Snap but still want to use a containerized format for certain desktop applications or get newer versions of programs than the *Ubuntu™ repositories provide.
Please know that both Flatpaks and Snaps use up more space of your storage medium than "traditional" binaries.
For Kubuntu™ 22.04 LTS absolutely read this post!
Other Ubuntu™-based distributions
No other Ubuntu™-based distributions/flavours but Kubuntu™ 20.04 LTS & later are officially supported.
In its current state my script does not work with Ubuntu™ (GNOME) or other GTK/GNOME-based flavours like Xubuntu™, Ubuntu MATE™, etc. as they use the Snap Store or the GNOME Software Center instead of Discover - to name just one example.
Due to the amount of time it would take to change and thoroughly test this script accordingly I will probably also not support them in the future.
But by all means feel free to use my script as a template to do so.
That said the script does work with Lubuntu™ and Ubuntu Studio™ (KDE Plasma) so far.
This is a little helper script for Kubuntu™ users who want to get rid of and block Snap entirely (like Linux Mint and TUXEDO OS do), including the Firefox Snap in 22.04 LTS & later and e.g. the Thunderbird and Firmware Updater Snaps in 24.04 LTS.
It has been tested many times with Kubuntu™ 20.04 LTS up to 24.04 LTS.
I hope you find the script useful! Yours respectfully, Schwarzer Kater
Installation and usage of this script
- You can download the script from here: https://gitlab.com/scripts94/kubuntu-get-rid-of-snap
Click on its name in the file list and on the next page use the download button on the far right side of the script name.
OR
Copy and paste the code of the script into a blank Kate text editor document and save it as "Kubuntu_get_rid_of_Snap.sh" to e.g. your home directory. - Make the file Kubuntu_get_rid_of_Snap.sh executable in the Dolphin file manager:
go to the directory you downloaded/saved the script to, right-click on the file and choose Properties --> Permissions --> enable Is executable --> choose OK.
OR
Make the file Kubuntu_get_rid_of_Snap.sh executable in the Konsole terminal emulator:
go to the directory you downloaded/saved the script to (cd [path to]/[name of directory], e.g. cd ~/Downloads) and enter:
chmod +x Kubuntu_get_rid_of_Snap.sh. - To run the script in the Konsole terminal emulator go to the directory you downloaded/saved the script to and enter:
./Kubuntu_get_rid_of_Snap.sh.
Important
- This script is best run after a fresh installation of Kubuntu™ but has also been written to be run directly after a release-upgrade to the next main Kubuntu™ version (e.g. from 23.10 to 24.04 LTS).
It should also work with a Kubuntu™ installation that has been used for a while - depending on your own system modifications - but BE AWARE THAT ALL PROGRAMS YOU ADDITIONALLY INSTALLED AS SNAPS WILL BE REMOVED TOO!
It has been designed to be run in combination with the reinstall_Snap_for_release-upgrade script.
- A full upgrade of the system (either with Discover or in Konsole with sudo apt update && sudo apt full-upgrade) AND a reboot is strongly recommended prior to running this script!
For some more information about what is done in detail see the comments within the script itself.
Known issues / bugs
- After removing Snap there can be an empty icon (which looks like a white sheet of paper) in the Plasma Panel, if e.g. the Firefox Snap was pinned there before.
--> The solution is to simply right-click on this icon and choose "Unpin from Task Manager".
- After removing Snap it is possible that Discover will offer you to "Install the missing Snap backend" in more recent versions of Kubuntu™.
This will not reinstall Snap to your system and you will still see no Snaps in Discover afterwards.
--> The solution is to run the reinstall_Snap_for_release-upgrade script if you want to have Snap back.
Additional tips
⦁ After removing the Firmware Updater Snap in Kubuntu™ 24.04 LTS one can still manage firmware with the Discover software center or use the command fwupdmgr (see fwupdmgr --help) in the Konsole terminal emulator.
If you want to have a separate graphical program you can additionally install the GNOME Firmware Flatpak.
⦁ Flatpak is a good alternative (and IMHO better suited for desktop usage than Snap) if you have removed Snap but still want to use a containerized format for certain desktop applications or get newer versions of programs than the *Ubuntu™ repositories provide.
Please know that both Flatpaks and Snaps use up more space of your storage medium than "traditional" binaries.
For Kubuntu™ 22.04 LTS absolutely read this post!
- Flatpak is easy to install - open your Konsole terminal emulator and enter:
sudo apt update && sudo apt install flatpak - To enable the Flathub repository for Flatpaks (which is currently the largest one and is supported by e.g. KDE and GNOME) enter:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
You can enable other Flatpak repositories like e.g. the one from Fedora or from individual developers later on if you wish to do so. - To be able to find, update, install and remove Flatpaks with the Discover software center you should additionally install the Discover support for Flatpak - enter:
sudo apt install plasma-discover-backend-flatpak - To manage Flatpak permission for Kubuntu™ 23.04 & later you can install the Flatpak Permissions Settings module for System Settings:
sudo apt install kde-config-flatpak
To manage Flatpak permissions for Kubuntu™ 20.04 to 22.10 you can install the Flatseal Flatpak. - Reboot your system or at least log out and in again.
Other Ubuntu™-based distributions
No other Ubuntu™-based distributions/flavours but Kubuntu™ 20.04 LTS & later are officially supported.
In its current state my script does not work with Ubuntu™ (GNOME) or other GTK/GNOME-based flavours like Xubuntu™, Ubuntu MATE™, etc. as they use the Snap Store or the GNOME Software Center instead of Discover - to name just one example.
Due to the amount of time it would take to change and thoroughly test this script accordingly I will probably also not support them in the future.
But by all means feel free to use my script as a template to do so.
That said the script does work with Lubuntu™ and Ubuntu Studio™ (KDE Plasma) so far.
Comment