Skip to content

Instantly share code, notes, and snippets.

@tazihad
Last active September 21, 2022 00:56
Show Gist options
  • Save tazihad/7faac7dadbdbd069650db53ffa266c60 to your computer and use it in GitHub Desktop.
Save tazihad/7faac7dadbdbd069650db53ffa266c60 to your computer and use it in GitHub Desktop.
Firefox stable is pain to install in Debian and in Ubuntu. Let's install self updating binary from directly mozilla.

Download Firefox. https://www.mozilla.org/en-US/firefox

Download the Firefox version you want directly from the official website Uncompress the archives:

  • in the /opt directory (system-wide installation - requires Root privileges)
  • in your home directory or ~/.opt (install only for the current user)

Create a file firefox-stable.desktop (replace stable with beta or nightly if needed) with the contents below:

  • in the /usr/share/applications directory (system-wide installation - requires Root privileges)
  • in the ~/.local/share/applications directory (install only for the current user)
[Desktop Entry]
Name=Firefox Stable
Comment=Web Browser
Exec=/opt/firefox/firefox %u
Terminal=false
Type=Application
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
StartupWMClass=firefox
Actions=Private;profile-manager-window;

[Desktop Action Private]
Exec=/opt/firefox/firefox --private-window %u
Name=Open in private mode

[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Exec=/opt/firefox/firefox --ProfileManager

Replace /opt/firefox with the path to the directory where you extracted the archive.

If you want to be able to launch Firefox from a CommandLineInterface, create a symlink to the firefox executable in /usr/local/bin/. For example: sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox

If you want to use your manually installed Firefox as the default DebianAlternatives browser (x-www-browser), run sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200 && sudo update-alternatives --set x-www-browser /opt/firefox/firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment