Score:0

Replacing snap with flatpak. What will happen when I upgrade?

gq flag

I'm considering replacing snap with flatpak. What happens during a version upgrade of Ubuntu? Is the Ubuntu upgrade programmed to reinstall snap and what is the risk of pinning or holding snap from being reinstalled?

I would like to avoid having to purge snap on every upgrade and don't want to risk ending up with a broken system because some key system component has become a snap package.

Lorenz Keel avatar
gr flag
Check here: [How to uninstall snap?](https://askubuntu.com/a/1285102/1037999) If you pin the `snap` package, it won't be reinstalled. I've tested it from 20.04 to 20.10, 20.10 to 21.04 and 21.04 to 21.10 transitions.
guiverc avatar
cn flag
Ubuntu 22.04 doesn't yet exist; it's currently the *development* release Ubuntu *jammy* and remains that until it reaches RC state which isn't expected until after 14 April 2022, and isn't on-topic here until release on 21 April 2022. https://discourse.ubuntu.com/t/jammy-jellyfish-release-schedule/23906 Please refer https://askubuntu.com/help/on-topic. For support issues with Ubuntu *jammy* you'll need to use a #ubuntu-next or #ubuntu+1 site (IRC, UF etc) *Ubuntu jammy is still in alpha; yes feature freeze has hit, but changes can still occur with SRUs so it's still a partial unknown*
guiverc avatar
cn flag
Ubuntu Forums allows those sort of *opinion* based questions.
user535733 avatar
cn flag
You may eventually lose printing: [CUPS](https://forum.snapcraft.io/t/cups-interface-merged-into-snapd-additional-steps-to-complete/28653) is in the (slow, methodical) process of transitioning from deb to snap. The developers cite too few volunteers to maintain and package and test multiple versions for different releases of Ubuntu -- the snap offers a significant reduction in their workload. More volunteers to do the work would, of course, preserve the deb option.
vanadium avatar
cn flag
@Lorenz Keel, why not post as an answer?
Lorenz Keel avatar
gr flag
@vanadium the question may be considered duplicated, so I preferred not to post an answer, but nonetheless I've put one, with some lines about pinning (so that it's not exactly a duplicate of the link I posted before).
ru flag
Keep in mind more and more of the GNOME environment is snapped nowadays, if you are using stock ubuntu and such you are going to eventually break your desktop environment if you don't keep snaps. The same with CUPS as well. And Firefox (which is now already fully `snap`ped).
Score:2
gr flag

apt gives the chance to pin a package. Further details about pinning are available using the terminal command man 5 apt_preferences.

The "Pin-Priority" parameter, in your specific case, can be used to prevent the re-installation of snapd package by giving it a negative priority.

Create a file no-snap.pref by issuingin a terminal:

sudo -H gedit /etc/apt/preferences.d/no-snap.pref

and then copy the following content in it:

# To install snapd, specify its version with 'apt install snapd=VERSION'
# where VERSION is the version of the snapd package you want to install.
Package: snapd
Pin: release a=*
Pin-Priority: -10

You can still install snapd if you want, but you need to explicitly set the package version in the sudo apt install command: you don't need to delete the /etc/apt/preferences.d/no-snap.pref file.

I've tested this procedure from 20.04 to 20.10 + 20.10 to 21.04 + 21.04 to 21.10 transitions. However, consider that for the GNOME variant of Ubuntu, the number of packages distributed as snap is increasing, and for some of them the decision has been taken not by Canonical but by the package distributor itself (for instance, Mozilla for firefox). In the future the removal of snapd may not be harmless.

ru flag
Note that if you are using the GNOME desktop variant of Ubuntu Desktop you will be sacrificing a lot of functionality as it's mostly snapped now instead of debian packaged. This will cause some issues if you aren't careful.
Lorenz Keel avatar
gr flag
@Thomas Ward, for what concerns me, I'm fully aware. However, I'll add a note in my answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.