snap + firefox made me angry

So today I went to pull up my favorite youtube channel and found that my once crisp and smooth 4K videos were choppy and unwatchable. I quickly discovered that snap forced an update to a firefox version which reset my video preferences.

I wasn’t a huge fan of snap to begin with as the backend servers are proprietary to Canonical and I don’t need yet another package manager layered on top of more package managers.

So I removed it. Here’s how I did it.

First, disable snap

user@host:~$ sudo systemctl disable snapd.service
Removed /etc/systemd/system/multi-user.target.wants/snapd.service.

user@host:~$ sudo systemctl disable snapd.socket
Removed /etc/systemd/system/sockets.target.wants/snapd.socket.

user@host:~$ sudo systemctl disable snapd.seeded.service
Removed /etc/systemd/system/multi-user.target.wants/snapd.seeded.service.
Removed /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service.

Next disable snaps

user@host:~$ snap list
Name               Version          Rev    Tracking         Publisher   Notes
bare               1.0              5      latest/stable    canonical✓  base
core20             20221212         1778   latest/stable    canonical✓  base
gnome-3-38-2004    0+git.6f39565    119    latest/stable/…  canonical✓  -
gtk-common-themes  0.1-81-g442e511  1535   latest/stable/…  canonical✓  -
snapd              2.57.6           17883  latest/stable    canonical✓  snapd

user@host:~$ sudo snap remove bare
bare is removed

user@host~$ sudo snap remove core20
core20 is removed

user@host:~$ sudo snap remove gnome-3-38-2004
gnome-3-38-2004 is removed

user@host:~$ sudo snap remove gtk-common-themes
gtk-common-themes is removed

user@host:~$ sudo snap remove snapd
snapd is removed

Now check and ensure that all snaps have been removed. Also note that there are some dependency chains here and things like snapd must be removed last.

user@host:~$ snap list
No snaps are installed yet. Try 'snap install hello-world'.

Now remove snapd

user@host:~$ sudo apt autoremove --purge snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  plasma-discover plasma-discover-backend-fwupd plasma-discover-common
Suggested packages:
  plasma-discover-backend-flatpak
Recommended packages:
  plasma-discover-backend-snap
The following packages will be REMOVED:
  firefox* libsnapd-qt1* plasma-discover-backend-snap* snapd* squashfs-tools*
The following packages will be upgraded:
  plasma-discover plasma-discover-backend-fwupd plasma-discover-common
3 upgraded, 0 newly installed, 5 to remove and 148 not upgraded.
Need to get 8,038 kB of archives.
After this operation, 104 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 plasma-discover-backend-fwupd amd64 5.24.7-0ubuntu0.1 [31.6 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 plasma-discover amd64 5.24.7-0ubuntu0.1 [451 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 plasma-discover-common all 5.24.7-0ubuntu0.1 [7,555 kB]
Fetched 8,038 kB in 1s (9,761 kB/s)               
(Reading database ... 216446 files and directories currently installed.)
Removing firefox (1:1snap1-0ubuntu2) ...
Removing plasma-discover-backend-snap (5.24.6-0ubuntu0.1) ...
Removing libsnapd-qt1:amd64 (1.60-0ubuntu1) ...
Removing snapd (2.57.5+22.04ubuntu0.1) ...
Warning: Stopping snapd.service, but it can still be activated by:
  snapd.socket
Removing squashfs-tools (1:4.5-3build1) ...
(Reading database ... 216309 files and directories currently installed.)
Preparing to unpack .../plasma-discover-backend-fwupd_5.24.7-0ubuntu0.1_amd64.deb ...
Unpacking plasma-discover-backend-fwupd (5.24.7-0ubuntu0.1) over (5.24.6-0ubuntu0.1) ...
Preparing to unpack .../plasma-discover_5.24.7-0ubuntu0.1_amd64.deb ...
Unpacking plasma-discover (5.24.7-0ubuntu0.1) over (5.24.6-0ubuntu0.1) ...
Preparing to unpack .../plasma-discover-common_5.24.7-0ubuntu0.1_all.deb ...
Unpacking plasma-discover-common (5.24.7-0ubuntu0.1) over (5.24.6-0ubuntu0.1) ...
Setting up plasma-discover-common (5.24.7-0ubuntu0.1) ...
Setting up plasma-discover (5.24.7-0ubuntu0.1) ...
Installing new version of config file /etc/xdg/autostart/org.kde.discover.notifier.desktop ...
Setting up plasma-discover-backend-fwupd (5.24.7-0ubuntu0.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
(Reading database ... 216312 files and directories currently installed.)
Purging configuration files for snapd (2.57.5+22.04ubuntu0.1) ...
Discarding preserved snap namespaces
Final directory cleanup
Removing extra snap-confine apparmor rules
Removing snapd cache
Removing snapd state
Purging configuration files for firefox (1:1snap1-0ubuntu2) ...
Purging configuration files for plasma-discover-backend-snap (5.24.6-0ubuntu0.1) ...

Next prevent apt and apt-get from using snap packages

user@host:~$ sudo su
user@host:~# cat << EOF > /etc/apt/preferences.d/no-snap
Package: *
Pin: release o=Ubuntu*
Pin-Priority: -1
EOF

user@host:~# cat /etc/apt/preferences.d/no-snap
Package: snapd
Pin: release o=Ubuntu*
Pin-Priority: -1
user@host:~# ^D
user@host:~$ 

Snap is removed, re-install firefox

user@host:~$ sudo add-apt-repository ppa:mozillateam/ppa
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main'
Description:
Mozilla Team's Firefox stable + 102 ESR and Thunderbird 102 stable builds

Support for Ubuntu 16.04 ESM is included.
More info: https://launchpad.net/~mozillateam/+archive/ubuntu/ppa
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Found existing deb entry in /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding deb entry to /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Found existing deb-src entry in /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding key to /etc/apt/trusted.gpg.d/mozillateam-ubuntu-ppa.gpg with fingerprint 0AB215679C571D1C8325275B9BDB3D89CE49EC21
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]                                       
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                 
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease                                              
Hit:5 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [97.1 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [257 kB]                 
Get:8 http://us.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B]  
Hit:9 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease             
Fetched 469 kB in 1s (358 kB/s)                            
Reading package lists... Done

user@host:~$ apt install firefox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  fonts-lyx
Recommended packages:
  xul-ext-ubufox
The following NEW packages will be installed:
  firefox
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 64.9 MB of archives.
After this operation, 239 MB of additional disk space will be used.
Get:1 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 firefox amd64 108.0.2+build1-0ubuntu0.22.04.1~mt1 [64.9 MB]
Fetched 64.9 MB in 4s (14.5 MB/s)                          
Selecting previously unselected package firefox.
(Reading database ... 216302 files and directories currently installed.)
Preparing to unpack .../firefox_108.0.2+build1-0ubuntu0.22.04.1~mt1_amd64.deb ...
Unpacking firefox (108.0.2+build1-0ubuntu0.22.04.1~mt1) ...
Setting up firefox (108.0.2+build1-0ubuntu0.22.04.1~mt1) ...
update-alternatives: using /usr/bin/firefox to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/firefox to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
Please restart all running instances of firefox, or you will experience problems.
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.10.2-1) ...

And that it. You’re all done.

Leave a Reply

Your email address will not be published. Required fields are marked *