Merge pull request #27828 from lkxed/20221104-4-How-to-Remove-Firefox-Snap-from-Ubuntu--21-10---

[手动选题][tech]: 20221104.4 ️ How to Remove Firefox Snap from Ubuntu (21.10 +).md
This commit is contained in:
Xingyu.Wang 2022-11-05 08:54:58 +08:00 committed by GitHub
commit b33007fbc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,131 @@
[#]: subject: "How to Remove Firefox Snap from Ubuntu (21.10 +)"
[#]: via: "https://www.debugpoint.com/remove-firefox-snap-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Remove Firefox Snap from Ubuntu (21.10 +)
======
**Ubuntu 21.10 Impish Indri and the following versions make Firefox Snap a default browser. If you dont like Snap, this is how you can remove it and use the stock version.**
There is always a debate about whether Snap is a better alternative to apt. And many users prefer it for their system, and some hates snap to its core. Ubuntu and Canonical consider it as one of the best installation repositories and package management tools for Linux. The primary reason Snap is hated is its slow startup time. However, that argument is for another article.
### Remove Firefox Snap version from Ubuntu
So, if you havent [heard the story][1], Ubuntu 21.10 (and all subsequent versions) ships Firefox as a Snap package by default. So, when you install Ubuntu 21.10 onwards, the default left-dock shortcut is a snap version of Firefox. And you can verify it using the various methods below.
![snap list - Firefox][2]
![Firefox snap desktop shortcut][3]
If you dont like Snap due to its [performance, and][4]storage issues, you can remove it via the following commands.
- Close all the Firefox instances if open.
- Open a terminal. Then run the below command.
```
sudo snap remove firefox
```
- Wait for the command to complete. This will remove the snap executables from your system and disconnect Firefox from various system services. But the home snap directory will still be there. You can manually remove that using the below command.
```
cd ~/snaprm -r firefox
```
### Install Firefox Alternative Methods
Now, as you removed Firefox, you have the following options to use this browser.
#### Method 1 Use PPA (Recommended)
- Before using this method, make sure to remove the snap version of Firefox as mentioned above.
- There is an [official PPA for Firefox][5], maintained by its development team. You can add this PPA to your software sources and use it to install the latest Firefox.
- Make sure to create a file using a text editor to create a preference file to stop Ubuntu from pickup the snap version of Firefox while running the apt update command.
```
sudo gedit /etc/apt/preferences.d/firefox-no-snap
```
- Add the following lines to the above file and save it.
```
Package: firefox*Pin: release o=Ubuntu*Pin-Priority: -1
```
- Use the following commands in sequence. The first command removes it from your system completely.
```
sudo apt purge firefox
sudo add-apt-repository ppa:mozillateam/firefox
sudo apt-get update
sudo apt install firefox
```
- After installation is finished, make sure to enable the auto-upgrade using the command below.
```
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
```
- Restart your system (optional) and enjoy the deb version of Firefox.
#### Method 2 Use the compressed executable of Firefox
- You can download the compressed Firefox executable for Ubuntu and other Linux from the official website (link below). Then extract it and double-click to run the firefox executable. This is the safest approach. You can still get updates if you use this method.
[Download Firefox][6]
![Download Firefox and Extract][7]
![And then run the executable][8]
#### Method 3 Use Flatpak for Firefox
- You can also use the [Flatpak version of Firefox][9], which is available below after [setting up Ubuntu for Flatpak][10]. Then you can run the below command to install.
```
flatpak install flathub org.mozilla.firefox
```
#### Method 4 Use Snap with less system coupling with Firefox
- If you think you can still continue with the Snap version but want less sandboxing in your system, then you may want to reinstall Firefox using the below command with a [classic switch][11].
```
sudo snap install firefox --classic
```
### Closing Notes
So, this is the step to remove the firefox snap version from Ubuntu 21.10 onwards. And some alternatives. I am inquisitive to find out what step Linux Mint takes, as they dont go well with Snap. Also, those distros depend on Ubuntu upstream repo for Firefox, Its interesting to see what they will do. Debian maintains its own repo, but its mostly the ESR version.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/remove-firefox-snap-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840
[2]: https://www.debugpoint.com/wp-content/uploads/2021/09/snap-list-Firefox.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/Firefox-snap-desktop-shortcut-1024x490.jpg
[4]: https://www.debugpoint.com/2021/03/clean-up-snap/
[5]: https://launchpad.net/~mozillateam/+archive/ubuntu/ppa
[6]: https://www.mozilla.org/en-US/firefox/new/
[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/Download-Firefox-and-Extract.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/09/And-then-run-the-executable.jpg
[9]: https://flathub.org/apps/details/org.mozilla.firefox
[10]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/
[11]: https://snapcraft.io/docs/snap-confinement