How to install normal Firefox in Kali Linux

Kali Linux has Firefox ESR installed. The letters ESR mean Extended Support Release. If to reduce to the dry rest, then in fact Firefox ESR is a usual Firefox which loses new functions and is less often updated, though it receives security updates. From time to time, the version of Firefox ESR is updated to the current one, and then again “freezes” in its development. And that's all – there are no other differences.

Nevertheless, some programs require the latest version of the usual Firefox in which there are all modern features. This article is dedicated to this issue – you can install a regular version of Firefox on Kali Linux without removing the default version Firefox ESR.

That is, to install normal Firefox or not – you decide. If you are not sure whether you need it, then you do not need it – use Firefox ESR.

Normal Firefox can be installed in two ways:

  • add a new repository to the application sources, import the corresponding keys and install an executable file from this repository. The advantages of this method are: automatic update of Firefox along with other packages in the system
  • download Firefox executable files directly and place them in the right folder. The advantages of this method: no need to add new repositories and keys. Disadvantage: you need to update the web browser manually.

I'll show you how to install Firefox in both of these ways, and you choose for yourself the one that you like best.

Installing Firefox from Ubuntuzilla: Mozilla Software Installer

As you might guess, this repository belongs to Ubuntu. The maitainers of Kali Linux strongly recommend not to add third-party repositories to the Kali Linux system, since this will almost certainly lead to problems.

This case is not an exception, if you simply add a web browser repository and just try to install it, an error will occur (it is described just below).

Therefore, in order for everything to go fine, you need to do this:

echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2667CA5C
sudo apt update
sudo dpkg-divert --remove /usr/bin/firefox
sudo rm /usr/bin/firefox
sudo apt install firefox-mozilla-build

dpkg-divert: error: 'diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by firefox-mozilla-build' clashes with 'local diversion of /usr/bin/firefox to /usr/bin/firefox-esr'

If you encountered an error while trying to install Firefox:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  firefox-mozilla-build
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/68.5 MB of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package firefox-mozilla-build.
(Reading database ... 409496 files and directories currently installed.)
Preparing to unpack .../firefox-mozilla-build_66.0.5-0ubuntu1_amd64.deb ...
dpkg-divert: error: 'diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by firefox-mozilla-build' clashes with 'local diversion of /usr/bin/firefox to /usr/bin/firefox-esr'
dpkg: error processing archive /var/cache/apt/archives/firefox-mozilla-build_66.0.5-0ubuntu1_amd64.deb (--unpack):
 new firefox-mozilla-build package pre-installation script subprocess returned error exit status 2
dpkg-divert: error: mismatch on divert-to
  when removing 'diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by firefox-mozilla-build'
  found 'local diversion of /usr/bin/firefox to /usr/bin/firefox-esr'
dpkg: error while cleaning up:
 new firefox-mozilla-build package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/firefox-mozilla-build_66.0.5-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

So to fix it you need to run the commands:

sudo dpkg-divert --remove /usr/bin/firefox
sudo rm /usr/bin/firefox
sudo apt remove --purge firefox-mozilla-build
sudo apt reinstall firefox-mozilla-build

Alternative way to install Firefox

This method affects the system less, just download and unpack the Firefox executable files.

To install the latest version of standard Firefox on Kali Linux, run the following commands:

wget -O firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
tar xvjf firefox.tar.bz2
sudo mv firefox /usr/lib/
sudo rm /bin/firefox /usr/bin/firefox
ln -s /usr/lib/firefox/firefox /bin/firefox

To check the version:

firefox -v
Mozilla Firefox 66.0.5

For start:

firefox

In the information about Firefox ESR (Menu → Help → About Firefox):

In the usual Firefox information:

To create a shortcut on the desktop, create and open a text file:

gedit Desktop/Firefox.desktop

Copy the following into it:

[Desktop Entry]
Name=Firefox
Encoding=UTF-8
Exec=sh -c "/bin/firefox"
Icon=/usr/lib/firefox/browser/chrome/icons/default/default128.png
StartupNotify=false
Terminal=false
Type=Application

Save and close the file.

Click the shortcut with the right mouse button and select “Allow Launching” there.

After that, Firefox can be launched by double clicking on this shortcut.

How to Update Firefox on Kali Linux

The program installed in this way will have the latest version at the time of the execution of commands, but over time new versions will be released. In order not to install them manually, you can create a script:

gedit firefox-update

Copy into it:

#!/bin/bash
 
installed=`firefox -v`
thelastone=`curl -s -I "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=ru" | grep -E -o 'firefox-[0-9.-]+tar.bz2' | grep -E -o '[0-9.]{5,}'`
if [[ "$installed."!="Mozilla Firefox $thelastone" ]]; then
	echo 'You have the last Firefox release'
	exit
fi
 
wget -O firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=ru"
tar xvjf firefox.tar.bz2
sudo rm -rf /usr/lib/firefox
sudo mv firefox /usr/lib/

Make it executable and move it to the directory in the PATH variable:

chmod +x firefox-update
sudo mv firefox-update /bin/

From time to time, run the file as follows:

sudo firefox-update

A version check will be made and if a newer version is released, it will be downloaded and installed.

Recommended for you:

2 Comments to How to install normal Firefox in Kali Linux

  1. Vladislav says:

    echo ‘deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main’ | sudo tee /etc/apt/sources.list.d/ubuntuzilla.list
    sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 2667CA5C
    sudo apt update
    sudo apt install firefox-mozilla-build

    Source: https://sourceforge.net/p/ubuntuzilla/wiki/Main_Page/#installation

Leave a Reply

Your email address will not be published.

Looking for a job in IT. Details: https://miloserdov.org/?p=2900