Amazon Cyber Monday deals See deals →ad

Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

Install Firefox on Ubuntu From the Terminal: Safe Options

On most current Ubuntu desktop releases, the quickest way to install Firefox from a terminal is sudo snap install firefox. You can also use APT, but on recent Ubuntu versions the firefox APT package is a transition package that installs the Snap version, so the command you choose affects how Firefox is packaged and updated.

Install Firefox with Snap

Open Terminal and run:

sudo snap install firefox

Enter your Ubuntu password if prompted; the terminal does not display characters as you type it. Snap downloads Firefox and installs it with its required runtime components. On a typical Ubuntu desktop, Snap support is already present. When installation finishes, open Firefox from the applications menu or start it by typing firefox in the terminal.

If the command says that snap was not found, your Ubuntu installation may not include the Snap service. On a standard Ubuntu system, you can install it with APT:

sudo apt update
sudo apt install snapd

Then try the Firefox Snap command again. Installing Snap may require starting its service or restarting the computer, depending on the system. If you are using a server, container, or customized Ubuntu image, check that Snap is supported and enabled in that environment before relying on this method.

What the APT command does on Ubuntu

APT is Ubuntu’s standard package manager, and many online guides suggest installing Firefox with:

sudo apt update
sudo apt install firefox

This remains a valid command, but its result depends on the Ubuntu release and configured software sources. On recent Ubuntu releases, including Ubuntu 22.04 and later desktop releases, Ubuntu’s Firefox APT package is a transitional package: it arranges installation of Firefox as a Snap rather than providing the traditional Firefox program files as a normal Debian package. The command can therefore lead to a Snap installation even though you used apt.

This packaging change is easy to mistake for an installation failure. APT may report that it is installing a package called Firefox, while the application itself is managed by Snap. That is expected behavior on those releases. If you specifically want a conventional APT-managed Firefox package, use a repository that provides one, such as Mozilla’s official APT repository, rather than assuming Ubuntu’s default firefox package is a separate deb build.

On older Ubuntu versions or systems with different repositories, the package behavior may differ. Check the release before following an old tutorial:

lsb_release -a

Always prefer instructions written for your Ubuntu release. Package names, default sources, and the supported lifetime of a release can change, so a command that worked on an older installation may not select the same package today.

Choose between Snap and a Mozilla APT package

For most Ubuntu users, the default Snap is the simplest choice. It follows Ubuntu’s current Firefox packaging approach, receives updates through Snap, and avoids adding another software repository. Choose it if your priority is a supported, straightforward installation and you do not have a specific reason to use a deb package.

A Mozilla-provided APT package can suit users who need Firefox to be managed as a conventional deb, for example because of a particular system-management workflow. It requires adding Mozilla’s repository and configuring APT, which is an extra maintenance decision. A repository is a source of software that your system may use for future updates, not just a one-time download; consider that before adding one.

  • Choose Snap for the default Ubuntu experience and the fewest setup steps.
  • Choose Ubuntu’s APT package if you want to use the standard Ubuntu package command and are comfortable with it installing the Snap on recent releases.
  • Choose Mozilla’s APT repository only if you specifically want Mozilla’s deb packaging and are willing to manage an additional software source.

Neither method is automatically best for every computer. Compatibility with your environment, the way your organization manages software, and your preference for update handling are more useful considerations than the package format’s name alone.

Install Mozilla’s Firefox package through APT

If you need Mozilla’s APT package rather than Ubuntu’s default Snap, use Mozilla’s official repository setup instructions and verify that they still apply to your Ubuntu release. The following is the general repository configuration approach: install the signing key, add a source entry tied to that key, set the package preference recommended by Mozilla, refresh APT’s package lists, and install Firefox.

sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo 'deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main' | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
echo 'Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000' | sudo tee /etc/apt/preferences.d/mozilla
sudo apt update
sudo apt install firefox

The signing key lets APT check that packages from the configured source are signed by the expected publisher. The signed-by setting limits which key is used for that repository, while the preference file gives packages from Mozilla’s source a higher priority. These settings affect package selection and updates, so do not paste them blindly into a managed work computer or a system where an administrator controls software sources.

Use Mozilla’s current instructions if the repository format or key location has changed. Do not disable package signature checks to get past an error. If you decide later that you no longer want the Mozilla repository, remove its source and preference files carefully, then review which Firefox package you want to keep before removing or replacing anything.

Open Firefox and check the installation

After installation, launch Firefox from the desktop applications menu. You can also start it from a terminal:

firefox

Starting a graphical program this way may keep the terminal occupied while Firefox is running; close the terminal only if you are sure that doing so will not stop the application in your environment. For a quick version check, run:

firefox --version

To confirm that the Snap package is installed, use:

snap list firefox

If you installed Firefox using Mozilla’s APT repository, inspect the package information with apt policy firefox. It shows the installed version and the available package sources, which can help explain whether Ubuntu or Mozilla is supplying the package. A successful command-line installation does not always create an obvious desktop shortcut immediately; logging out and back in or checking the applications menu can help refresh the desktop’s view.

Updates, profiles, and existing Firefox data

Firefox updates through the mechanism associated with its package. Snap installations receive updates through Snap, while a deb installation receives updates through APT from its configured sources. Keeping the browser updated matters because updates include security fixes as well as new features. You generally do not need to download a new installer manually each time an update is released.

Installing Firefox normally does not mean you must delete your existing bookmarks or settings. Firefox stores profile data separately from the application files, and an existing profile may be detected when you open the browser. If you are switching between packaging formats, however, do not assume that every installation will use exactly the same profile location or immediately show the same profile. Back up important bookmarks and other data before making a major package change, and use Firefox Sync or the browser’s export tools if you need to move data deliberately.

Running two Firefox builds at once can also create confusion about which profile or version you are using. If you are troubleshooting, first identify how Firefox is installed, then remove or replace only the package you intend to change. Avoid deleting profile directories as a shortcut: those folders can contain browsing data, saved settings, and other information that is separate from the application itself.

Common installation problems

  • snap: command not found: Snap is not installed or available in that environment. On a supported Ubuntu system, install snapd with APT and try again; on a restricted system, ask its administrator about the approved package method.
  • APT cannot find the package: Run sudo apt update and check that the correct Ubuntu repositories are enabled. If you are following Mozilla repository instructions, check that the source file was added correctly and that the repository is reachable.
  • Firefox opens an older version: Check firefox --version and inspect the package source with snap list firefox or apt policy firefox. You may have multiple launchers or installation methods, so verify which executable is being started before reinstalling.
  • Permission or network errors: Use sudo only for the installation commands that need administrator privileges. Check your network connection and system time, and do not work around certificate or signature errors by turning off verification.
  • The command succeeds but no window appears: On a machine without a graphical desktop, Firefox cannot open a normal browser window. In a desktop session, try launching it from the applications menu and note any error printed in the terminal.

If installation fails, read the complete error message before trying random fixes. A failure to reach a repository, a missing package, and a package-signature problem have different causes. In particular, commands copied from unrelated distributions can add incompatible repositories or alter package priorities, making a simple browser installation harder to repair.

Remove or change an installation

To remove the Snap version, run:

sudo snap remove firefox

To remove a Firefox package installed through APT, use:

sudo apt remove firefox

On recent Ubuntu versions, removing the APT transition package may not behave like removing a traditional standalone Firefox deb, because the browser is provided by Snap. Check the package status and remove the package using the tool that owns the installation. If you added Mozilla’s repository and want to stop using it, remove its source and preference configuration only after deciding what should provide future Firefox updates.

Uninstalling the browser is not the same as erasing personal browser data. Keep a backup if you plan to remove profiles or reset Firefox. Conversely, if your goal is simply to reinstall after a problem, preserving the profile may save time and retain bookmarks, but it can also preserve a setting that caused the original issue.

Frequently Asked Questions

What is the terminal command to install Firefox on Ubuntu?
For the standard installation on most current Ubuntu desktops, run sudo snap install firefox. You can also run sudo apt update followed by sudo apt install firefox, but on recent releases that APT package installs or leads to the Snap version.

Why does apt install firefox install Snap?
Recent Ubuntu releases use a transitional APT package for Firefox that directs installation to Ubuntu’s Snap package. APT is still the command you ran, but Snap manages the installed browser and its updates.

Can I install Firefox without Snap?
Yes. One option is Mozilla’s official APT repository, which provides Firefox as an APT-managed package. Adding a repository changes your software sources, so follow Mozilla’s current instructions and understand how that source will provide future updates.

How do I start Firefox from Terminal?
Type firefox and press Enter in a desktop session. To check its version, run firefox --version. If no graphical window appears on a server, that may be because the system has no desktop session.

Will installing Firefox delete my bookmarks?
A normal installation is not intended to erase bookmarks, which are stored in a Firefox profile rather than in the browser’s program files. Still, back up important data before switching package formats, removing profiles, or troubleshooting with a reset.

Install Firefox on Ubuntu From the Terminal: Safe Options
Scroll to top