In Debian 10 there is this command to choose the default browser:
update-alternatives --config x-www-browser
I installed Waterfox from a .deb file and it is not showing up in the list of available browsers. Is there a way to add it?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYour setup is probably similar to mine, I have two entries in the link group x-www-browser
for Firefox and Google Chrome. Let's take this as example:
$ update-alternatives --display x-www-browser
x-www-browser - auto mode
link best version is /usr/bin/google-chrome-stable
link currently points to /usr/bin/google-chrome-stable
link x-www-browser is /usr/bin/x-www-browser
slave x-www-browser.1.gz is /usr/share/man/man1/x-www-browser.1.gz
/usr/bin/firefox-esr - priority 70
slave x-www-browser.1.gz: /usr/share/man/man1/firefox-esr.1.gz
/usr/bin/google-chrome-stable - priority 200
There are two symbolic links setup pointing to the selected entry:
$ ls -l /usr/bin/x-www-browser
lrwxrwxrwx 1 root root 31 Sep 16 2018 /usr/bin/x-www-browser -> /etc/alternatives/x-www-browser
$ ls -l /etc/alternatives/x-www-browser
lrwxrwxrwx 1 root root 29 May 4 20:45 /etc/alternatives/x-www-browser -> /usr/bin/google-chrome-stable
And the interactive menu shows Google Chrome as auto-selected (highest priority):
$ update-alternatives --config x-www-browser
There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/google-chrome-stable 200 auto mode
1 /usr/bin/firefox-esr 70 manual mode
2 /usr/bin/google-chrome-stable 200 manual mode
Press <enter> to keep the current choice[*], or type selection number:
To add an entry, you need the --install
command, the link, the link name, the path to the program and priority.
Change the path to Waterfox and priority as needed:
sudo update-alternatives \
--install /usr/bin/x-www-browser x-www-browser /usr/local/bin/waterfox 210
Result:
$ update-alternatives --config x-www-browser
There are 3 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/local/bin/waterfox 210 auto mode
1 /usr/bin/firefox-esr 70 manual mode
2 /usr/bin/google-chrome-stable 200 manual mode
3 /usr/local/bin/waterfox 210 manual mode
Press <enter> to keep the current choice[*], or type selection number:
You can setup optional slave links as shown for Firefox above. If Firefox is selected, an additional link x-www-browser.1.gz
pointing to the man page /usr/share/man/man1/firefox-esr.1.gz
is setup.
The syntax for --slave
is the same as for --install
, but without priority, e.g.:
sudo update-alternatives \
--install /usr/bin/x-www-browser x-www-browser /usr/local/bin/waterfox 210 \
--slave /usr/share/man/man1/x-www-browser.1.gz x-www-browser.1.gz /usr/local/share/man/man1/waterfox.1.gz
To remove Waterfox again, you need the link name and path:
sudo update-alternatives --remove x-www-browser /usr/local/bin/waterfox