I just updated from Ubuntu 20.04 to 22.04 and it looks since then Firefox can't open a file. When I download a file from a website, I get the dialog box "Open with... System Handler (default)". I try that and it looks the file is downloaded but I can't open it or even access the folder when it was downloaded. I have Firefox 105.0.3 (64 bits) Mozilla Firefox Snap for Canonical-002 - 1.0
4 Answers
Likely your firefox is installed with snap and it doesn't have privileges, simplest solution is to reinstall it with Ubuntu package from mozilla repository.
This is what worked for me:
- Remove snap firefox installation:
sudo snap remove firefox
- Add mozilla repo
sudo add-apt-repository ppa:mozillateam/ppa
3.Change priority, so ubuntu will use repo instead of snap
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
- Install Firefox:
sudo apt install firefox
These steps were taken from there: https://fosspost.org/how-to-install-firefox-as-a-deb-package-on-ubuntu-22-04/
- 41
snap packages are used to improve security in several different ways. The parts that help:
- a snap package gets installed in its own environment (a
chrootenvironment) - snap dependencies have to be installed within its environment (avoid using an invalid / incompatible / unsafe version of a package)
- access to files on your system from a snap package is controlled by
apparmor
so you have several solutions:
one is to find an up to date version of the .deb but Ubuntu was saying that they would stop producing those... yet it looks like there are PPAs with the latest
save the files in different locations to be able to open them; it should work from your folders (under your
/home/<login>). This may still fail if apparmor prevents firefox from starting other binaries.edit the apparmor settings to allow firefox to do this and/or that; the apparmor files are not in the snap since they are required for the main host apparmor system; the ones for firefox are found here:
$ ls /var/lib/snapd/apparmor/profiles/snap.firefox.* /var/lib/snapd/apparmor/profiles/snap.firefox.firefox /var/lib/snapd/apparmor/profiles/snap.firefox.geckodriver /var/lib/snapd/apparmor/profiles/snap.firefox.hook.configure /var/lib/snapd/apparmor/profiles/snap.firefox.hook.connect-plug-host-hunspell /var/lib/snapd/apparmor/profiles/snap.firefox.hook.disconnect-plug-host-hunspell /var/lib/snapd/apparmor/profiles/snap.firefox.hook.post-refreshYou need to edit
/var/lib/snapd/apparmor/profiles/snap.firefox.firefoxand make the changes to make it all work. For example, to allow execution of binaries under~/bin, you could add something like:@{HOME}/bin rx, # allow Read & eXecute under /home/<login>/binOnce done with the edits, run:
sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.firefox.firefoxthen restart firefox.
As for the change itself, it depends on what you are trying to do. To access a file in a directory, that directory needs to be allowed. The type of access is defined by a set of letters.
Note 1: The changes you make are going to be overwritten each time the snap is refreshed. So make sure to make a clear copy of you changes so you can re-apply them. Outside of that side problem, it's probably the best solution.
Note 2: The changes to
snap.firefox.firefoxare for all users on your machine. If you have multiple users, you may want to reconsider. At the same time, installing the .deb would allow anyone to (nearly) do anything as before without any real protection.
- 2,787
Maybe this can help you:
Try to install [Firefox without snap].1
If that does not work, try this:
If any of the following settings are in bold text, reset their values. To reset a value, click the Delete Fx71aboutconfig-DeleteButton or Reset Fx71aboutconfig-ResetButton button, depending on the preference:
browser.download.dir
browser.download.downloadDir
browser.download.folderList
browser.download.lastDir
browser.download.useDownloadDir
For me browser.download.useDownloadDir had "false" value. Reset button change to true and everything is working now.
See also https://support.mozilla.org/en-US/kb/cant-download-or-save-files
- 1,147
I'll put yet another answer. In my case I have installed on Ubuntu the XFCE window manager so as to run remote desktop via VNC. There was GNOME desktop by default, but it was too difficult for me to configure along with VNC so I removed it and installed XFCE. Among another problems, I also wasn't able to open "Browse" window on Firefox. What I did was:
- ensure
xdg-desktop-portalis installed - remove old
xdg-desktop-portal-gnomepackage - install
xdg-desktop-portal-xappwhich is "Xapp's Cinnamon, MATE and Xfce backends for xdg-desktop-portal"
- 111