1. Remove existing Firefox installs

Start by removing any pre-installed versions of Firefox from both APT and Snap:

root@th121-1:/root# apt purge firefox  
root@th121-1:/root# apt autopurge  
root@th121-1:/root# snap remove --purge firefox
 

2. Move the Firefox archive into /opt

Assuming you already have the Firefox .tar.bz2 archive saved in /systems/software/, copy it to /opt and navigate there:

root@th121-1:/root# cp /systems/software/firefox-122.0.tar.bz2 /opt  
root@th121-1:/root# cd /opt

3. Extract and link Firefox

Extract the archive and create a symbolic link so the firefox command works globally:

root@th121-1:/opt# tar -xvf firefox-122.0.tar.bz2  
root@th121-1:/opt# ln -s /opt/firefox/firefox /usr/bin/firefox

4. Set up the application launcher

Now create a desktop entry so Firefox shows up in your system’s applications menu:

root@th121-1:/opt# vi /usr/share/applications/firefox.desktop

 

Paste the following content inside:

[Desktop Entry]  
Name=Firefox  
Comment=Browse the World Wide Web  
Exec=/opt/firefox/firefox %u  
Icon=/opt/firefox/browser/chrome/icons/default/default128.png  
Terminal=false  
Type=Application  
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

 

5. Refresh application listings and exit

Run the desktop database updater and log out to finalize changes:

root@th121-1:/opt# update-desktop-database  
root@th121-1:/opt# logout

You should now be able to find and launch Firefox from your desktop environment.