Saturday, September 30, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1211  / 7 Months ago, wed, march 8, 2023, 10:10:23

Is there a mechanism for stopping an individual Snap from updating?


There is an ongoing issue with Firefox snap and have decided to replace the snap version with the deb version using the instructions contained in this FOSTips post in so far as it related to Ubuntu 22.04 LTS.

The Issue

After following the instructions (with the exception that the "Set PPA Priority" fails since the file mentioned does not exist in 22.04) I noted that, following an update, the Snap version of Firefox was restored to the system and the issue I was having returned accordingly.

The issue concerns an incorrect rendering of the web page from the Dropbox drop down menu. This issue was resolved by installing the deb version of Firefox. It is not clear whether it is an issue with Dropbox (less likely) or the snap version of `Firefox (most likely).

Other Research

I have considered the options set out in this Q&A from AU but these solutions do not mention preventing the automatic re-installation of a package as part of the update process behind the scenes, just in the main a delaying process.

Since I wish to entirely disable updates to this snap (but allow other snaps which perform well to be updated) in isolation is there a specific set of workable commands available to achieve this?

More From » updates


To your general question, "How to stop an individual snap from updating Ubuntu 22.04 LTS", the answer is, as you also found out: you can't. There is little user control on snap updates - they update automatically and that cannot be stopped. That is one of the criticism about snap.

To your specific question with respect to Firefox snap being installed on an update, it is actually the firefox APT package of Ubuntu that is being updated. That package triggers an install of the snap version. There are many tutorials out nowadays on how to replace the snap version by a .deb version from a third party repository.

For updates of APT packages, there is a lot more control. The installation of the Ubuntu version of firefox specifically could be prohibited with following APT preference:

cat <<EOF | sudo tee /etc/apt/preferences.d/firefox-no-snap.pref
Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1

This creates a configuration file /etc/apt/preferences.d/firefox-no-snap.pref that instructs APT to forbid installing the firefox .deb package of the default Ubuntu repositories. Thus, the snap version of firefox only can be installed manually by the snap install firefox command. A firefox package from another source could still be installed.

There are many tutorials to be found on how to replace the snap Firefox by a deb version. All involve configuration changes to APT, either by promoting the priority of firefox from a third party PPA, or demoting the priority of the default Ubuntu package.

[#514] Friday, March 10, 2023, 7 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 400
Total Questions: 103
Total Answers: 98

Location: Netherlands
Member since Mon, Jun 22, 2020
3 Years ago