Install Firefox on Linux
Revision Information
- Revision id: 229680
- Created:
- Creator: unixfan
- Comment: Hyperlinked the installation methods
- Reviewed: No
- Ready for localization: No
Revision Source
Revision Content
To use Firefox, you must install it first. This article will show you how to do so.
If you don't use Linux, read the article corresponding to your operating system:
Installation Methods
There are several installation methods available:
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:
sudo apt install firefox
on Debian and Ubuntu.
Flatpak
Flatpak is a package management system that's independent of any specific Linux distribution. To setup Flatpak, visit FlatPak's setup guide and select your operating system. Then, follow the installation steps.
Once you have Flatpak installed, visit the Firefox Flathub page and click the button. Once downloaded, follow the command line instructions at the bottom of the page.
To update the Flatpak package of Firefox, run:
flatpak update
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 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:
flatpak update --subpath=/fr org.mozilla.firefox.Locale
Snap
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 installation instructions for your distribution. Once you have installed snapd, run this command to install Firefox:
sudo snap install firefox
Mozilla's Official Package
- Before you install Firefox, ensure that you have installed the 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
Follow these steps to install Mozilla's official Firefox package:
- Download Firefox from the download page and save it to your Downloads directory
- Open a terminal and go to your Downloads directory:
cd ~/Downloads
- Extract the contents of the downloaded file:
tar xjf firefox-*.tar.bz2
- Move the extracted directory to /opt:
sudo mv firefox /opt/
- Open your user's profile file:
nano ~/.profile
- Enter the following line in ~/.profile:
PATH=$PATH:/opt/firefox
- Reload your profile:
source ~/.profile
- Open firefox by typing firefox in the terminal
- Delete the installation file:
rm firefox-*.tar.bz2
If you want a menu entry for Firefox on your application launcher
- Create a .desktop file in your applications folder
sudo touch /usr/local/share/applications/firefox.desktop
- Open the .desktop file:
sudo nano /usr/local/share/applications/firefox.desktop
- Copy and paste the following text into the file:
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Troubleshoting
This section addreesses common errors and how to resolve them.
libstdc++5 error
As noted above, you need to install the 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:
env | grep PATH
Firefox runs as an XWayland client on my Wayland compositor
To make Firefox run as a Wayland client, run nano ~/.profile
in your terminal and paste the
this line in it:
export MOZ_ENABLE_WAYLAND=1
Then, refresh your profile by running:
source ~/.profile
Now, Firefox will start as a Wayland client.