运行“x-www-brower”时出现“snap 命令允许您...”,但运行“/snap/bin/firefox”有效

运行“x-www-brower”时出现“snap 命令允许您...”,但运行“/snap/bin/firefox”有效

我正在尝试使用 snap firefox 作为我的默认浏览器,但是当我尝试运行默认的 x-www-browswer 时,似乎 snap 正在运行。

$ ls -a /snap/bin/firefox 
/snap/bin/firefox
$ ls -l /snap/bin/firefox 
lrwxrwxrwx 1 root root 13 Feb 17 17:42 /snap/bin/firefox -> /usr/bin/snap
$ ls -l /etc/alternatives/x-www-browser 
lrwxrwxrwx 1 root root 17 Feb 17 17:15 /etc/alternatives/x-www-browser -> /snap/bin/firefox
$ ls -l /usr/bin/x-www-browser 
lrwxrwxrwx 1 root root 31 Feb 17 17:15 /usr/bin/x-www-browser -> /etc/alternatives/x-www-browser
$ which x-www-browser 
/usr/bin/x-www-browser
$ x-www-browser 
The snap command lets you install, configure, refresh and remove snaps.
Snaps are packages that work across many different Linux distributions,
enabling secure delivery and operation of the latest apps and utilities.

Usage: snap <command> [<options>...]

Commonly used commands can be classified as follows:

         Basics: find, info, install, remove, list
        ...more: refresh, revert, switch, disable, enable, create-cohort
        History: changes, tasks, abort, watch
        Daemons: services, start, stop, restart, logs
    Permissions: connections, interface, connect, disconnect
  Configuration: get, set, unset, wait
    App Aliases: alias, aliases, unalias, prefer
        Account: login, logout, whoami
      Snapshots: saved, save, check-snapshot, restore, forget
         Device: model, reboot, recovery
      ... Other: warnings, okay, known, ack, version
    Development: download, pack, run, try

For more information about a command, run 'snap help <command>'.
For a short summary of all commands, run 'snap help --all'.

$ sudo update-alternatives --config x-www-browser
There is only one alternative in link group x-www-browser (providing /usr/bin/x-www-browser): /snap/bin/firefox
Nothing to configure.

答案1

## update snap's aliases
sudo snap alias firefox gnome-www-browser
sudo snap alias firefox x-www-browser
## update the alternatives list...
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /snap/bin/firefox 1000
sudo update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser /snap/bin/firefox 1000

相关内容