Skip to content

Instantly share code, notes, and snippets.

@mmguero
Last active October 20, 2022 21:37
Show Gist options
  • Save mmguero/ec741cd2b547710f56c3cc79d331c00c to your computer and use it in GitHub Desktop.
Save mmguero/ec741cd2b547710f56c3cc79d331c00c to your computer and use it in GitHub Desktop.
install latest linux64 Firefox
#!/bin/bash
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
curl -o /tmp/firefox.tar.bz2 -L "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US"
if [[ $(file -b --mime-type /tmp/firefox.tar.bz2) = 'application/x-bzip2' ]]; then
sudo mkdir -p /opt
sudo rm -rvf /opt/firefox
sudo tar -xvf /tmp/firefox.tar.bz2 -C /opt/
rm -vf /tmp/firefox.tar.bz2
if [[ -f /opt/firefox/firefox ]]; then
sudo rm -vf /usr/local/bin/firefox
sudo ln -rs /opt/firefox/firefox /usr/local/bin/firefox
sudo tee /usr/share/applications/firefox.desktop > /dev/null <<'EOT'
[Desktop Entry]
Name=Firefox
Comment=Web Browser
GenericName=Web Browser
X-GNOME-FullName=Firefox Web Browser
Exec=/opt/firefox/firefox %u
Terminal=false
X-MultipleArgs=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;
StartupWMClass=Firefox
StartupNotify=true
EOT
dpkg -s firefox-esr >/dev/null 2>&1 && sudo apt-get -y --purge remove firefox-esr
fi
fi # /tmp/firefox.tar.bz2 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment