Firefox doesn't open - how can I correct this?

Solution 1:

If you search for Firefox and don't find it, that suggests it's not installed.

To be sure, open a Terminal window (Ctrl+Alt+T) and run:

which firefox
dpkg -l | grep firefox

If you get nothing, or all the entries given by the second command start with something other than ii (like rc), then Firefox is not installed.

You can install firefox Install firefox from the Software Center or by running:

sudo apt-get update && sudo apt-get install firefox

If you get something, try running Firefox from the command-line:

firefox

If that works, then you've solved the main problem (and you can solve the problem of why you cannot run Firefox from the dash at your leisure).

If that does not work, then the way it doesn't work will provide valuable diagnostic information about the problem. In that case, please edit your question to include this information (or, for people other than the author of this question: you can search for your problem and post a new question if you don't find a solution).

I've listed some examples below of how it might not be working, along with some solutions.

###If the Command-Line Shell Cannot Find Firefox Either

You might see an error like this when you try to run firefox:

  • firefox: command not found
  • The program 'firefox' is currently not installed. ...

The fix is to Install the firefox package.

Or if it's installed, reinstall it with sudo apt-get --reinstall install firefox.

(See below for another, more effective of reinstallation, which really does more than just reinstalling.)

###Crashing

You might get an error that says Segmentation fault, core dumped, assert, assertion, or any combination of those.

That means Firefox has crashed. So you should consider reporting the bug. Read this carefully. (This question is a good resource too.) This is a crash, so you'll want to attach a stack trace: here's how that works, here's some privacy considerations (particularly relevant here since information from your Firefox profile might end up attached). Configure Apport to submit crash data for attachment to your bug report. Produce the crash and report the bug. But also try the fix below, as whether or not it works should be noted in your bug report--also, because that can help you use Firefox!

###General Failure to Run

If there is no error, Firefox just hangs without a message, or quits immediately (or crashed as above), there are two fixes/workarounds:

  1. Try running Firefox as another user (or as Guest). Any user-specific problem won't occur.

  2. Your Firefox profile is stored in a folder called .mozilla in your home folder (as suggested in vasa1's comment). Rename it to .mozilla.old (Ctrl+H shows hidden items like this in Nautilus).

    If you prefer, here's the command-line way:

     mv ~/.mozilla ~/.mozilla.old
    

    Whichever way you use, make sure Firefox isn't running at all when you do it. (You can run ps | grep -v grep | grep firefox if you like, to check.)

    Then run Firefox, and it should generate a new profile. If the problem was related to or triggered by data in your old profile, renaming the profile should fix it.

    Running Firefox with a new profile will fix most (though not absolutely all) user-specific problems. (It won't fix all of them because some can be in programs other than Firefox.)

###Reinstalling the Package and Purging Systemwide Configuration Files

Sometimes when a program is not working, reinstalling the package that provides it with fresh systemwide configuration files (as sean_m suggested) can help. This is really doing things:

  1. Reinstalling the package replaces any corrupted files with new files (and also, if done in the optimal way, makes sure you get the latest version of the package provided by your software sources).
  2. Eliminating any modifications manually, automatically, or inadvertently made to systemwide configuration files can solve problems arising from your system's local configuration.

To reinstall Firefox and with new configuration files (as well as new copies of other files, like the Firefox executable), run:

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

This (and any other "purge" method) only replaces systemwide configuration files--files that affect the configuration for all users. This does not affect individual users' profiles or other user-specific configuration.

See man apt-get and the Ubuntu wiki for more information about what the --purge flag (and the purge action) does.