Updating or uninstalling and reinstalling Firefox on Linux

  • I am trying to upgrade Firefox on Linux, and it is not working. I thought about uninstalling it and reinstalling it, but I don't have a clue about how to do that. Can anyone help me?

  • Quit Firefox Effectively

    First make sure Firefox is not running:

    ps ax | grep [f]irefox

    If it is running, quit it. If it doesn't appear to be running but appears in the list from ps ax, kill it by running killall firefox, waiting a few seconds, then running killall -KILL firefox. If you don't see firefox: no process found after the second killall command, run that second command again. If you still don't see it, reboot (or you may want to try running it with sudo too, thought that won't usually help).

    Consider Clearing Your Profile

    If you want to clear out your profile (which can fix many problems, especially problems relating to upgrading Firefox to a new version), then rename the folder called .mozilla that resides in your home folder. There's two ways to do this:

    • In Nautilus (the GUI file browser): Press Ctrl+H or click ViewShow Hidden Files. Then you can see files and folders that start with a .. Go to your home folder if you're not already there, and rename .mozilla to .mozilla.old (or whatever you want to call it).

    • On the command-line: Open a Terminal window (Ctrl+Alt+T) and run the command:

      mv ~/.mozilla ~/.mozilla.old

      (Or put whatever you want to call it, in place of .mozilla.old.)

    The idea behind renaming the folder instead of deleting it is so you can restore it. But if its contents are keeping Firefox (or a recently installed newer version of Firefox) from working, then you may have trouble actually using them later!

    Therefore, if there's anything you want to save--often, this will be your bookmarks--you should back that up first, before you do this. (This article may help with that.)

    Finally, note that I'm certainly not advocating clearing your profile regularly, or even every time you upgrade Firefox. It's only when you have severe problems after upgrading that I recommend trying it. (If it makes no difference, you can rename .mozilla.old back to .mozilla--you may have to remove a newly created .mozilla first. That's one of the reasons to back up the whole profile.)

    Reinstall Firefox (from the latest version in any of your software sources)

    To reinstall Firefox, removing global configuration files and getting the latest version available in any of the software sources configured on your Ubuntu system, run:

    sudo apt-get update
    sudo apt-get --purge --reinstall install firefox

    Should apt-get upgrade be run too?

    Running sudo apt-get upgrade is not necessary for getting the latest available Firefox, because the install command will automatically fetch and install or upgrade to the latest installable version, and whatever other packages (if any) are needed to enable that version to install.

    With that said, it's reasonable to run sudo apt-get upgrade in this situation. You may want to bring all your software up to date, and that can even potentially help with some interoperability problems. (New versions of some packages and really old versions of others have not necessarily been tested together, after all.)

    If you're accustomed to using the Software Updater (Update Manager in older Ubuntu releases), go ahead and do that. If you prefer to use the command-line:

    sudo apt-get upgrade
    sudo apt-get dist-upgrade

    Of course, if you haven't run sudo apt-get update shortly before running those, you should do that. And sudo apt-get dist-upgrade will upgrade packages that require the installation of new packages or removal of currently installed packages, so you should make sure to look at what it says it plans to do, before letting it proceed.

    (To address a common confusion: dist-upgrade does not attempt to upgrade your Ubuntu system to a later Ubuntu release, though on some other OSes it's used for that purpose in combination with manually editing a configuration file. See this explanation of dist-upgrade. Running sudo apt-get update, sudo apt-get upgrade, and sudo apt-get dist-upgrade in that order approximates the behavior of the Software Updater / Update Manager and tends to work well.)

    It does not recognise apt-get, sorry I am no good at this xx

    @GailKelly What do you mean? *What happens, exactly?*

  • Just entering the following in my terminal on Ubuntu Trusty Tahr worked fine for me for upgrading.

    sudo apt-get install firefox
  • If you use Ubuntu, you can use the following commands:

    sudo apt-get purge firefox
    mv ~/.mozilla ~/mozilla-backup
    sudo apt-get install firefox

    These commands will remove Firefox and your Firefox profile data and install again Firefox.

    To update Firefox to the last version using:

    sudo apt-get update
    sudo apt-get upgrade

    sudo apt-get upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list.

  • I installed Firefox and repeatedly got an error when I attempted to open it.

    (process:2705): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed Error: Access was denied while trying to open files in your profile directory.

    Initially, I could only run firefox by typing sudo firefox--far from ideal. I ran across the solution below, and that fixed my issue.

    "Solution found here" . Answer is pasted below as well.

    ls .cache/mozilla/
    ls: cannot open directory .cache/mozilla/:
    Permission denied

    chown -R user.user .cache/mozilla/>
    chown: cannot read directory ‘.cache/mozilla/’:
    Permission denied

    sudo chown -R user.user .cache/mozilla/

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM