Compare Revisions
Install Firefox on Linux
Revision 201423:
Revision 201423 by anlazar on
Revision 229656:
Revision 229656 by unixfan on
Keywords:
ubuntu opensuse
ubuntu opensuse
Search results summary:
This article will show you how to install Firefox on Linux.
This article explains how to install Firefox on Linux.
Content:
Getting Firefox installed on your computer is your first step to using it. This article will show you how to install Firefox on Linux.
For other operating systems see:
*[[Installing Firefox on Windows]]
*[[Installing Firefox on Mac]]
*[[Run Firefox on ChromeOS]]
Many Linux distributions include Firefox by default while most have a package management system - a preferred way to install Firefox. Package management system will:
* Ensure that you have all the required libraries
* Install Firefox optimally for your distribution
* Create shortcuts to launch Firefox
* Make Firefox available to all users of your computer
* Make removing Firefox work the same as removing any other application
Package management system has downsides:
* It may not give you the latest Firefox version
* It may give you a version without Firefox branding
You can also install Firefox through the Flatpak option.
=Install from Flatpak=
Flatpak is a new packaging format for Linux. To setup Flatpak, [https://flatpak.org/setup/ visit FlatPak's setup guide] and select your OS and follow the installation steps.
Once you have Flatpak installed, [https://flathub.org/apps/details/org.mozilla.firefox go to the Firefox Flathub page] and click the {button Install} button. Once downloaded, follow the command line instructions at the bottom of the page.
Once Firefox is installed from Flatpak, updates are automatic so no need to reinstall.
==Download a specific locale version==
When installing Flatpak (via the command line or via the Flathub url link), the OS locale is being checked (OS locale and not the browser accept language header) and Flathub only sends the locales that share the same prefix. So for example if <code>LANG=en_US.UTF-8</code> Flatpak will send locales that have the common prefix <code>en</code> which are <code>en-CA, en-GB</code> etc.
To download a specific locale it can be done manually. For example, specific installation of French (fr) locale:<br>
<code>flatpak update --subpath=/fr org.mozilla.firefox.Locale</code>
= Install from a package manager =
To install Firefox using the package manager, please refer to your Linux distribution's documentation.
= Install outside of a package manager =
The support sites for some Linux distributions have complete instructions on how to install Firefox without using a package manager, although a few information may be out of date<!--(L10n must translate and uncomment these extra words)--><!--, on the original page or in the translated version-->. For example:
* [https://help.ubuntu.com/community/FirefoxNewVersion Installing Firefox on Ubuntu]
* [http://en.opensuse.org/Firefox Installing Firefox on OpenSuse]
You can also follow the instructions below to manually install on each user's account.
{note}
* '''Before you install Firefox''', make sure that your computer has the ''' [http://www.mozilla.org/firefox/system-requirements.html required libraries]''' installed. Missing libraries will cause Firefox to be inoperable.
* The installation file provided by Mozilla in '''.tar.bz2''' format has pre-compiled binary files as opposed to sources. There is no need to compile the program from the source: simply unpack and run the binaries.
* The following instructions will install Firefox into your home directory. '''Only the current user''' will be able to '''run it'''.{/note}
# Download Firefox from the [https://www.mozilla.org/firefox/linux/?utm_medium=referral&utm_source=support.mozilla.org Firefox download page] to your home directory.
# Open a '''Terminal''' and go to your home directory:
#;<code>cd ~</code>
# Extract the contents of the downloaded file:
#;<code>tar xjf firefox-*.tar.bz2</code>
# Close Firefox if it's open.
# To start Firefox, run the {filepath firefox} script in the {filepath firefox} folder:
#;<code>~/firefox/firefox</code>
#;Firefox should now start. You can then create an icon on your desktop to run this command.
# There's no need to keep the installation file:
#;<code>rm firefox-*.tar.bz2</code>
== libstdc++5 error ==
As noted above, you need to install the [http://www.mozilla.org/firefox/system-requirements.html required libraries] for Firefox to work. Many distributions don't include libstdc++5 by default.
== "firefox not installed" message or wrong version of Firefox starts ==
If Firefox is installed following the instructions given above, it must be started (in a '''Terminal''' or in a launcher on the Desktop, for example) using the command: <code>~/firefox/firefox</code>
If you try to start Firefox in a '''Terminal''' with the command: <code>firefox</code>, it will either start the package-manager-installed version of Firefox or will tell you the program is not installed.
To use Firefox, you must install it first. This article will show you how to do so.
{note}
If you don't use Linux, read the article corresponding to your operating system:
*[[Installing Firefox on Windows]]
*[[Installing Firefox on Mac]]
*[[Run Firefox on ChromeOS]]
{/note}
=Installation Methods=
There are several installation methods available:
* Your Linux distribution's package manager
* Flatpak
* Snap
* Mozilla's official package
==Your Distribution's Package Manager==
Many Linux distributions include Firefox by default, and most have a package management system: a set of tools
that help you install, upgrade, downgrade, and uninstall software. Using your distribution's package manager
has three advantages:
* It installs all the libraries that Firefox depends on automatically
* Creates a menu entry for Firefox automatically
* Make uninstalling Firefox easy by only having to run one command
Using your distribution's package manager has two disadvanages:
* It may not provide the latest Firefox version
* It may provide a version without Firefox branding
* It may have unwanted distribution specific patches for Firefox
To install Firefox with your package manager, run the install command for it. For example, we run:
<blockquote><code>sudo apt install firefox</code></blockquote>
on Debian and Ubuntu.
==Flatpak==
[https://www.flatpak.org/ Flatpak] is a package management system that's independent of any specific Linux
distribution. To setup Flatpak, visit FlatPak's [https://flatpak.org/setup/ setup guide] and select your
operating system. Then, follow the installation steps.
Once you have Flatpak installed, visit the [https://flathub.org/apps/details/org.mozilla.firefox Firefox Flathub page]
and click the {button Install} button. Once downloaded, follow the command line instructions at the bottom
of the page.
To update the Flatpak package of Firefox, run:
<blockquote><code>flatpak update</code></blockquote>
This updates all Flatpak packages, including Firefox, to the latest available version.
===Download a specific locale version===
When you install Firefox with Flatpak, it checks the OS [https://en.wikipedia.org/wiki/Locale_(computer_software) locale]
to determine which language to use.
You must manually download the locale you want if it's different than the locale your operating system uses. For example,
to get the French language locale (fr), run:
<blockquote><code>flatpak update --subpath=/fr org.mozilla.firefox.Locale</code></blockquote>
==Snap==
[https://snapcraft.io/about Snap] is a package management system that's independent of specific Linux
distributions and shares many features with Flatpak. To use Snap on your Linux distribution, follow the
snapd [https://snapcraft.io/docs/installing-snapd installation instructions] for your distribution. Once you
have installed snapd, run this command to install Firefox:
<blockquote><code>sudo snap install firefox</code></blockquote>
==Mozilla's official package==
{note}
* '''Before you install Firefox''', ensure that you have installed the ''' [http://www.mozilla.org/firefox/system-requirements.html required libraries]'''. Missing libraries will cause Firefox to be inoperable.
* The installation file provided by Mozilla in '''.tar.bz2''' format has pre-compiled binary files as opposed to source code. This means you can unpack the tar file and run the binaries.
* If you have any other version of Firefox installed, change the name of the extracted firefox binary to another name
{/note}
Follow these steps to install Mozilla's official Firefox package:
# Download Firefox from the [https://www.mozilla.org/firefox/linux/?utm_medium=referral&utm_source=support.mozilla.org download page] and save it to your Downloads directory
# Open a terminal and go to your Downloads directory:
#;<blockquote><code>cd ~/Downloads</code></blockquote>
# Extract the contents of the downloaded file:
#;<blockquote><code>tar xjf firefox-*.tar.bz2</code></blockquote>
# Move the extracted directory to /opt:
#;<blockquote><code>sudo mv firefox /opt/</code></blockquote>
# Open your user's profile file:
#;<blockquote><code>nano ~/.profile</code></blockquote>
# Enter the following line in ~/.profile:
#;<blockquote><code>PATH=$PATH:/opt/firefox</code></blockquote>
# Reload your profile:
#;<blockquote><code>source ~/.profile</code></blockquote>
# Open firefox by typing {filepath firefox} in the terminal
# Delete the installation file:
#;<blockquote><code>rm firefox-*.tar.bz2</code></blockquote>
{note}
===If you want a menu entry for Firefox on your application launcher===
# Create a '''.desktop''' file in your applications folder
#;<blockquote><code>sudo touch /usr/local/share/applications/firefox.desktop</code></blockquote>
# Open the '''.desktop''' file:
#;<blockquote><code>sudo nano /usr/local/share/applications/firefox.desktop</code></blockquote>
# Copy and paste the following text into the file:
<code>
[Desktop Entry] <br/>
Version=1.0 <br/>
Name=Firefox <br/>
GenericName=Web Browser <br/>
Exec=firefox %u <br/>
Icon=firefox <br/>
Terminal=false <br/>
Type=Application <br/>
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; <br/>
StartupNotify=true <br/>
Categories=Network;WebBrowser; <br/>
</code>
{/note}
=Troubleshoting=
This section addreesses common errors and how to resolve them.
==libstdc++5 error==
As noted above, you need to install the [http://www.mozilla.org/firefox/system-requirements.html required libraries]
for Firefox to work.
==Running Firefox in the terminal gives "firefox: command not found" message or it doesn't start when clicking the menu entry in your application launcher==
You must check whether /opt/firefox is in your path. You can do this by running:
<blockquote><code>env | grep PATH</code></blockquote>
==Firefox runs as an XWayland client on my Wayland compositor==
To make Firefox run as a Wayland client, run <code>nano ~/.profile</code> in your terminal and paste the
this line in it:
<blockquote><code>export MOZ_ENABLE_WAYLAND=1</code></blockquote>
Then, refresh your profile by running:
<blockquote><code>source ~/.profile</code></blockquote>
Now, Firefox will start as a Wayland client.