Linux set default browser

GNOME

In the Default Applications section of the GNOME Settings, you can set your default web browser for your user in the «Web» dropdown.

Default for GNOME sessions (system-wide)

The default GNOME browser can be changed for the whole system by reconfiguring the alternative.

# update-alternatives --config gnome-www-browser

Default for KDE sessions (user-specific)

Under System Settings > Applications > Default Applications > Web Browser, change the «Open http and https URLs» setting to «in the following application» and choose your preferred browser from the dropdown list, then apply the change.

To change how htm or html files are handled when they are clicked in your file manager, change the preference under System Settings > Applications > File Associations, then search for «html» in the filetype search bar at the top. Under the «text» category, the «html» item lets you set the application preference in order. Move your favorite browser to the top.

Foreign applications

Default for foreign programs (system-wide)

Programs which are not designed for the user’s desktop environment do not obey the browser settings of the desktop environment (GNOME or KDE). For example, Thunderbird ignores desktop environment-specific browser settings. The default browser for generic applications can be changed for the whole system by reconfiguring the x-www-browser alternative.

# update-alternatives --config x-www-browser

Default for foreign programs (user-specific)

Some applications use xdg-open (part of xdg-utils). xdg-settings can be used to both get and change the default browser. Local settings can also be found in the users’ home in ~/.config/mimeapps.list.

$ xdg-settings get default-web-browser chromium.desktop
$ xdg-settings set default-web-browser firefox-esr.desktop

Also, you should change mimeapps.list since some applications don’t follow x-www-browser:

$ cat ~/.config/mimeapps.list [Default Applications] x-scheme-handler/http=google-chrome.desktop x-scheme-handler/https=google-chrome.desktop [Added Associations] x-scheme-handler/http=google-chrome.desktop x-scheme-handler/https=google-chrome.desktop

Removing alternative browsers from the system

This method involves removing all the other browsers installed on the system, so that the desired one remains the only one. Sometimes this is not feasable (multiuser system, dependencies) and is the least elegant.

Читайте также:  Kaspersky small office security linux

Any of the previous methods is preferred to this one, but this method can be useful for lightweight systems.

Opening the default browser from a script

If you’re writing a script or application for Debian that needs to be able to open the default browser, your best option is to use thesensible-browser wrapper from the sensible-utils package. This tests the common symlinks (x-www-browser, gnome-www-browser, www-browser, etc.) and chooses the most «sensible» browser out of them.

The environment variable BROWSER can be set to override its selection and force it to always choose your desired browser.

Источник

Set Your Favorite Browser as Default through Ubuntu Command Line

Set Ubuntu Default Browser

You may have several web browsers installed on our Ubuntu that we want to use for different browsing preferences. However, there is always one favorite browser that we want to use for regular Internet usage 90% of the time. It is best to set this browser as the default browser for your Ubuntu system. This default browser is the one that opens links you click on in any Ubuntu application, and it opens when you type x-www-browser in your Ubuntu command line.

Setting the default web browser from the Ubuntu user interface is very simple. You just need to open the Preferences utility, go to the Details tab, click on Default Applications, and then select your preferred web browser from the Web drop-down menu.

Ubuntu default Browser settings

However, this article explains how to achieve the same purpose through the Ubuntu command line. It explains how we can use the update-alternatives utility to update one of the installed browsers as the default browser. It’s good to learn this trick since we don’t always have the UI available. For example, a server administrator or a remote user can easily access the command line and make configurations on the target computer.

Читайте также:  Linux transparent huge pages

We have tested the commands and procedures mentioned in this article on various Unbuntu systems from version 18.04 to Ubuntu 22.04. We use the Terminal application to access the Ubuntu command line. You can open it via the System Dash or the key combination Ctrl+Alt+T.

How to set the default Browser on the shell?

Open your Terminal applications and enter the following command as sudo:

$ sudo update-alternatives –config x-www-browser

Please note that only an authorized user on Ubuntu can install, remove, update and configure applications.

This command lists all the available web browsers on your system.

Use update-alternatives command to set default browser

The ‘*’ symbol before the selection number indicated the currently set default web browser.

Simply enter the selection number against a web browser option and hit Enter to set a new default alternative.

By default, this list contains web browsers from the /usr/bin directory. If your web browsers are located somewhere else, for example in /snap/bin, you can add it to the alternatives list by running the following command:

$ sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /snap/bin/chromium 200

Set default Browser to Chromium

In our case, our Chromium web browser was installed in the /snap/bin folder. Through the above command, we could not only set it as our default browser but also add it to the update-alternatives list for later use.

Hopefully, through the simple commands described in this article, you will be able to easily set a new default web-browser for your Ubuntu system.

Источник

Изменение используемого по умолчанию веб-браузера

При нажатии на ссылке на веб-странице в любом приложении, веб-браузер автоматически откроет эту страницу. Тем не менее, если установлено несколько веб-браузеров, страница может открыться не в том браузере, который вам нужен. Чтобы исправить это, выберите веб-браузер, используемый по умолчанию:

  1. Откройте Обзор и начните введить: Приложения по умолчанию .
  2. Нажмите Приложения по умолчанию , чтобы открыть панель.
  3. Выберите веб-браузер, в котором должны открываться ссылки, изменив параметр Веб .

Когда вы откроете другой веб-браузер, он может сообщить, что больше не является браузером, используемым по умолчанию. В этом случае нажмите кнопку Отменить (или другую подобную), чтобы он больше не пытался установить себя в качестве используемого по умолчанию браузера.

Читайте также:  Загрузка модуля в линукс

Дополнительная информация

You can choose the displayed language by adding a language suffix to the web address so it ends with e.g. .html.en or .html.de.
If the web address has no language suffix, the preferred language specified in your web browser’s settings is used. For your convenience:
[ Change to English Language | Change to Browser’s Preferred Language ]

The material in this document is available under a free license, see Legal for details.
For information on contributing see the Ubuntu Documentation Team wiki page. To report errors in this documentation, file a bug.

Источник

How to set Google Chrome as the default browser?

How can I set Google Chrome as the default browser? If I set it in the browser settings, nothing happens. The browser says it’s default, but in preferred applications in Gnome, there’s only Firefox to choose from. Clicking any link i.e in Thunderbird opens a blank Firefox window, not with the link embedded. Can I set the default browser in dconf2 or any configuration file?

7 Answers 7

Assuming you are using Unity, click on the dash button in the launcher and search for ‘System info’. Then, open ‘System info’ and move to ‘Default applications’ section. Then, click on the dropdown list next to Web. There, select ‘Google Chrome’ and it will be selected as the default web browser for your system.

enter image description here

Oh well! I was looking for this myself! They really got away with hiding and removing settings in this Ubuntu version, I thought Default Applications was removed! In Gnome Shell you can access it through System Settings > System Info > Default Applications.

You should have in the ~/.config/mimeapps.list file the following lines:

text/html=google-chrome.desktop x-scheme-handler/http=google-chrome.desktop x-scheme-handler/https=google-chrome.desktop x-scheme-handler/about=google-chrome.desktop x-scheme-handler/unknown=google-chrome.desktop 

Make sure these lines are under either the [Default Applications] or [Added Associations] section.

And of course, you need google-chrome installed such that google-chrome.desktop is either located at /usr/share/applications/ , /usr/local/share/applications/ or ~/.local/share/applications/ .

Источник

Оцените статью
Adblock
detector