# Firefox on Raspberry Pi Links: [[Raspberry Pi]] ## Official Install ```bash sudo apt install firefox ``` - This actually uses snap under the hood, which causes problems when working with a remote desktop... ### "Failed to execute default Web Browser Input/output error." - Couldn't find a solution while sticking with the snap install - Possible fix: run `/usr/bin/firefox` with the `--no-sandbox` flag as suggested [here](https://superuser.com/a/1564549). [This bug report thread](https://community.apachefriends.org/f/viewtopic.php?t=76653&p=259881) also mentions the error message "Running as root without --no-sandbox is not supported. See https://crbug.com/638180." This didn't work for me though If you open a terminal *within* the remote desktop and run `sudo /usr/bin/firefox` you get the error: ```bash $ sudo /usr/bin/firefox --no-sandbox mkdir: cannot create directory '/run/user/0': Permission denied Authorization required, but no authorization protocol specified Error: cannot open display: :1.0 ``` - [This askubuntu thread](https://askubuntu.com/questions/1009698/permission-for-snap-applications) reports a similar problem with a different package (`notepadqq`) also installed via snap. Their solution was to get the deb-packaged version and run it: ```bash snap remove notepadqq sudo add-apt-repository -y ppa:notepadqq-team/notepadqq sudo apt-get update sudo apt-get install notepadqq ``` - "The problem is that /run/user/0 does not exist because this directory is supposed to be created by the session manager, not the snap. Because this is being run under sudo, it implies that the session is non-root so /run/user/0 wasn't ever created by anything." - [source](https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1751634) - "This is an old issue" then links to: - [https://bugs.launchpad.net/snappy/+bug/1656340](https://bugs.launchpad.net/snappy/+bug/1656340) - [https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186](https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186) - [https://github.com/snapcore/snapd/pull/4365#discussion_r155843451](https://github.com/snapcore/snapd/pull/4365#discussion_r155843451) - More generally, [Permission denied error when running apps installed as snap packages](https://askubuntu.com/questions/930437/permission-denied-error-when-running-apps-installed-as-snap-packages-ubuntu-17) notes that snap is broken in all kinds of ways and that "The workaround right now is to remove `snap` and install things from `*.tar.gz` or from `*.deb` packages." ## Install with .Deb package ### Adapted from [How to Install Firefox as a .Deb on Ubuntu 22.04 (Not a Snap)](https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04) - all credit theirs ### Instructions Remove the Firefox Snap ```bash sudo snap remove firefox ``` Add the (Ubuntu) Mozilla team PPA to your list of software sources by running the following command in the same Terminal window: ```bash sudo add-apt-repository ppa:mozillateam/ppa ``` Next, alter the Firefox package priority to ensure the PPA/deb/apt version of Firefox is preferred. (copy and paste it whole, not line by line) ```bash echo ' Package: * Pin: release o=LP-PPA-mozillateam Pin-Priority: 1001 ' | sudo tee /etc/apt/preferences.d/mozilla-firefox ``` - [Original source](https://fostips.com/ubuntu-21-10-two-firefox-remove-snap/) of this line: FosTips Since you’ll (hopefully) want future Firefox upgrades to be installed automatically, run the following: ```bash echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox ``` - [Original source](https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/) of this line: Balint Reczey's blog Finally, install Firefox via apt: ```bash sudo apt install firefox ``` ### More resources - [How to Remove Firefox Snap & Switch Back Classic Deb in Ubuntu 22.04](https://fostips.com/ubuntu-21-10-two-firefox-remove-snap/) - [Firefox on Ubuntu 22.04 from .deb (not from snap)](https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/) - [How to Install Latest Firefox as classic Deb in Ubuntu 22.04](https://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/)