Updating or uninstalling and reinstalling Firefox on Linux
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 foundafter the second
killallcommand, run that second command again. If you still don't see it, reboot (or you may want to try running it with
sudotoo, 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
.mozillathat resides in your home folder. There's two ways to do this:
In Nautilus (the GUI file browser): Press Ctrl+H or click View → Show 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.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
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--you may have to remove a newly created
.mozillafirst. 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
apt-get upgradebe run too?
sudo apt-get upgradeis not necessary for getting the latest available Firefox, because the
installcommand 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 upgradein 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 updateshortly before running those, you should do that. And
sudo apt-get dist-upgradewill 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-upgradedoes 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
sudo apt-get update,
sudo apt-get upgrade, and
sudo apt-get dist-upgradein that order approximates the behavior of the Software Updater / Update Manager and tends to work well.)
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 upgradeis used to install the newest versions of all packages currently installed on the system from the sources enumerated in
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: cannot open directory .cache/mozilla/:
chown -R user.user .cache/mozilla/>
chown: cannot read directory ‘.cache/mozilla/’:
sudo chown -R user.user .cache/mozilla/