134

Is there an option to change my default browser for all my applications?

Seth
  • 58,122
Ederico
  • 6,097

8 Answers8

128

Have a look at your system-settings -> Details:

(Note that in older versions of Ubuntu Details is called System Info)

enter image description here

Jorge Castro
  • 71,754
fossfreedom
  • 172,746
  • 10
    Wow, that's a pretty stupid place to put it! Almost as bad as having to go to "settings" to turn off your computer in Windows 8. – Mike Dec 08 '13 at 00:25
  • 4
    in ubuntu 14.04 [cinnamon theme] navigate to System Settings > Preferred applications – xkeshav Jul 25 '14 at 11:31
  • To launch this on Ubuntu 14.04 from the CLI try unity-control-center http://askubuntu.com/questions/116655/what-is-the-command-to-run-system-settings-from-a-terminal – Winny Aug 10 '15 at 04:34
  • How do I make an application show up in there? – Anaphory Oct 19 '16 at 16:28
  • To access this from CLI use gnome-control-center and go to System > Details. You will also need to use update-alternatives from Sergey P. aka azure's answer below, since different programs reads settings from different sources. – Boris Bukh Jan 17 '19 at 16:09
  • I cannot find it in Lubuntu 20_04 – Timo Mar 09 '21 at 19:27
  • In german: 'Vorgabeanwendungen' – Sebastian Mar 24 '24 at 13:20
68

This is an ubuntu way of doing this

sudo update-alternatives --config x-www-browser
sudo update-alternatives --config gnome-www-browser
  • This is a system-wide change, and should be done in addition to fossfreedom's answer. – Flimm Dec 11 '13 at 11:56
  • 3
    I tried all the answers here; only the second of these two lines changed the browser in which browser-external links (e.g. from Pidgin) opened. – Stew Jun 25 '14 at 15:57
  • This is the most appropriate way to do this, working for i3WM and other desktop environments where terminals rules. Thank you for sharing. – Geppettvs D'Constanzo Apr 30 '17 at 14:38
  • This didn't work for me on ubuntu 16.04 (was trying to change the browser used by thunderbird to open links). The accepted solution worked. – Étienne Apr 26 '18 at 07:15
  • Actually it's the Debian way.... "The Debian alternatives system was originally created for Debian but has been picked up by other GNU/Linux software distributions." https://wiki.debian.org/DebianAlternatives – PJ Brunet Jul 20 '23 at 02:53
64

If your preferred browser isn't in that menu or you prefer doing it from the command line, this command will let you do the same thing as in fossfreedom's answer:

xdg-settings set default-web-browser name-of-browser.desktop

E.g.:

xdg-settings set default-web-browser firefox.desktop

or

xdg-settings set default-web-browser chromium-browser.desktop

or

xdg-settings set default-web-browser google-chrome.desktop
Cybolic
  • 815
  • 4
    For SEO reasons: this works with i3wm when chrome sneaks into x-www-browser and update-alternatives is out of reach because it requires sudo. You need to have my-application.desktop available, for example in ~/.local/share/applications/my-app.desktop. But you don't pass the entire path to xdg-settings, only the file name. – black_puppydog Sep 26 '17 at 12:58
  • 1
    This is the right solution. It works on every distro. – Adrian Lopez May 31 '20 at 13:05
  • Incidentally, I needed to do (unset BROWSER; xdg-settings set default-web-browser firefox-esr.desktop) (I normally use BROWSER=lynx) because the mere presence of that environment variable made xdg-settings refuse to do its job. While update-alternatives is also a point worth looking at, this is the one I was looking for and that corresponds to “default browser” as the browsers themselves see; thanks! – mirabilos Jan 26 '23 at 05:56
19

All preferences about default applications your user located in file "mimeapps.list". I am use Gnome 3 and Debian, so for me it is ~/.config/mimeapps.list.

I you don`t know where is may be located this file, try command:

locate mimeapps.list

For override default a web browser you need, at least, change values in category [Default Applications]

  • x-scheme-handler/http
  • text/html
  • application/xhtml_xml
  • image/webp
  • x-scheme-handler/https
  • x-scheme-handler/ftp
  • x-scheme-handler/https
  • x-scheme-handler/ftp

and in category [Added Associations]

  • text/html
  • text/xml
  • application/xhtml_xml
  • image/webp
  • x-scheme-handler/https
  • x-scheme-handler/ftp

For Opera the file ~/.config/mimeapps.list must contains:

[Default Applications]
x-scheme-handler/http=opera-browser.desktop
text/html=opera-browser.desktop
text/xml=opera-browser.desktop
application/xhtml_xml=opera-browser.desktop
image/webp=opera-browser.desktop
x-scheme-handler/https=opera-browser.desktop
x-scheme-handler/ftp=opera-browser.desktop

[Added Associations]
text/html=opera-browser.desktop;
text/xml=opera-browser.desktop;
application/xhtml_xml=opera-browser.desktop;
image/webp=opera-browser.desktop;
x-scheme-handler/https=opera-browser.desktop;
x-scheme-handler/ftp=opera-browser.desktop;

Try it (must be open in Opera, if it installed)

xdg-open somehtmlfile.html

For Chrome the file ~/.config/mimeapps.list must contains:

[Default Applications]
x-scheme-handler/http=google-chrome.desktop
text/html=google-chrome.desktop
text/xml=google-chrome.desktop
application/xhtml_xml=google-chrome.desktop
image/webp=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop
x-scheme-handler/ftp=google-chrome.desktop

[Added Associations]
text/html=google-chrome.desktop;
text/xml=google-chrome.desktop;
application/xhtml_xml=google-chrome.desktop;
image/webp=google-chrome.desktop;
x-scheme-handler/https=google-chrome.desktop;
x-scheme-handler/ftp=google-chrome.desktop;

Try it (must be open in Chrome, if it installed)

xdg-open somehtmlfile.html

And so on (Firefox, or something else).

You need only override desire mimetypes. But I recommend use GUI for it. It will be reduce amount of errors.

It is actual for me system and will be change from system to system, from desktop environment to desktop environment, and so on.

Testing environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.6 (jessie)
Release:    8.6
Codename:   jessie
$ uname -a
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
$s gnome-session --version
gnome-session 3.14.0
PADYMKO
  • 453
2

System -> Control Center -> Preferred Applications
for ubuntu with MATE DESKTOP

al3x2ndru
  • 121
1

You can also change your default browser in the relevant browser settings - e.g.

Firefox:
Preferences, tick 'Always check if Firefox is your default browser'

Chromium:
Settings, click 'Make chrome default browser'

Wilf
  • 30,194
  • 17
  • 108
  • 164
Sambit
  • 1,224
  • 1
  • 10
  • 14
1

Apart from some of the comments above, I would suggest following the top answer here. It involves changing the mimeapps/url schemes of your current user.

I had to use that solution to make linux Skype behave normally. Most other applications would use x-www-browser or gnome-www-browser but I guess they do have a point of using the URL Schemes; sometimes it has more sense.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Jan Sep 30 '14 at 08:04
  • I thought this still answered the question for Skype for which as far as I know, the changes in the top answer don't influence how skype chooses the default application in all conditions. The answer is here to help users in case the first one does not. If this can be done by responding with comments to the first answer I will do just that. :) Thank you for the heads up! – Adrian Castravete Sep 30 '14 at 08:39
  • Got your point, Adrian – just sitting in the same boat. Still, that didn't solve it for me. What solved it, was this answer. But that might be due to the fact I'm using LXDE as desktop. – Izzy Mar 07 '15 at 23:16
0
  • open brave browser then click top right corner icon then click Settings.

  • you will see something like: enter image description here

+Now set as default browser button(3rd link).

suhailvs
  • 1,373
  • 1
  • 13
  • 21