如何更改默认浏览器?

是否可以选择更改我的所有应用程序的默认浏览器?

看看你的system-settings – > Details

(请注意,在旧版本的Ubuntu Details中称为System Info

在此处输入图像描述

这是一种ubuntu方式

 sudo update-alternatives --config x-www-browser sudo update-alternatives --config gnome-www-browser 

如果您的首选浏览器不在该菜单中,或者您更喜欢从命令行执行此操作,则此命令将允许您执行与fossfreedom的答案相同的操作:

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

例如:

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

要么

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

要么

 xdg-settings set default-web-browser google-chrome.desktop 

您的用户在文件“mimeapps.list”中找到的有关默认应用程序的所有首选项。 我使用的是Gnome 3和Debian,所以对我来说它是~/.config/mimeapps.list

我不知道这个文件位于哪里,试试命令:

 locate mimeapps.list 

对于覆盖默认,您需要的Web浏览器至少会更改[默认应用程序]类别中的

  • 的x方案处理程序/ HTTP
  • text / html的
  • 应用程序/ xhtml_xml
  • 图像/ WEBP
  • 的x方案处理程序/ HTTPS
  • X-方案处理程序/ FTP
  • 的x方案处理程序/ HTTPS
  • X-方案处理程序/ FTP

和类别[已添加的关联]

  • text / html的
  • 文/ XML
  • 应用程序/ xhtml_xml
  • 图像/ WEBP
  • 的x方案处理程序/ HTTPS
  • X-方案处理程序/ FTP

对于Opera~/.config/mimeapps.list文件必须包含:

 [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; 

试试吧(必须在Opera中打开,如果安装的话)

 xdg-open somehtmlfile.html 

对于Chrome ,〜/ .config / mimeapps.list文件必须包含:

 [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; 

试一试(必须在Chrome中打开,如果已安装)

 xdg-open somehtmlfile.html 

等等(Firefox,或其他)。

你只需要覆盖欲望mimetypes。 但我建议使用GUI。 这将减少错误的数量。

它对我来说是实际的系统,将从一个系统变为另一个系统,从桌面环境变为桌面环境,等等。

测试环境

 $ 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 

除了上面的一些评论,我建议在这里给出最佳答案。 它涉及更改当前用户的mimeapps / url方案。

我不得不使用该解决方案使Linux Skype正常运行。 大多数其他应用程序将使用x-www-browsergnome-www-browser但我猜他们确实有使用URL Schemes的观点; 有时它更有意义。

您还可以在相关的浏览器设置中更改默认浏览器 – 例如

火狐:
首选项,勾选'始终检查Firefox是否是您的默认浏览器'

铬:
设置,点击“制作Chrome默认浏览器”

系统 – >控制中心 – >首选应用程序
对于带有MATE DESKTOP的ubuntu