AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1444962
Accepted
LightJack05
LightJack05
Asked: 2022-12-11 07:14:18 +0800 CST2022-12-11 07:14:18 +0800 CST 2022-12-11 07:14:18 +0800 CST

无法在 WSL 中安装 Firefox,因为它说我需要使用 snap,但 snap 不起作用

  • 772

所以我想用 Ubuntu 在 WSL2 中安装 firefox。现在,使用

sudo apt install firefox

给我这个输出:

Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  firefox
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.3 kB of archives.
After this operation, 261 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 firefox amd64 1:1snap1-0ubuntu2 [72.3 kB]
Fetched 72.3 kB in 0s (420 kB/s)
Preconfiguring packages ...
Selecting previously unselected package firefox.
(Reading database ... 24109 files and directories currently installed.)
Preparing to unpack .../firefox_1%3a1snap1-0ubuntu2_amd64.deb ...
=> Installing the firefox snap
==> Checking connectivity with the snap store
===> System doesn't have a working snapd, skipping
Unpacking firefox (1:1snap1-0ubuntu2) ...
Setting up firefox (1:1snap1-0ubuntu2) ...
update-alternatives: using /usr/bin/firefox to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/firefox to provide /usr/bin/x-www-browser (x-www-browser) in auto mode

此时尝试启动 firefox 将失败:


Command '/usr/bin/firefox' requires the firefox snap to be installed.
Please install it with:

snap install firefox

运行上述 snap 命令后,我得到以下信息:

error: cannot communicate with server: Post "http://localhost/v2/snaps/firefox": dial unix /run/snapd.socket: connect: no such file or directory

谁能帮我这个?我不是 Linux 专家。

apt
  • 2 2 个回答
  • 31 Views

2 个回答

  • Voted
  1. Best Answer
    Hannu
    2022-12-11T07:41:05+08:002022-12-11T07:41:05+08:00

    快速回答:

    使用浏览器查看:
    https ://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/

    它说,简而言之 (如果你已经做过,你可能需要跳过前两个):

    sudo snap remove firefox
    sudo apt remove firefox
    sudo add-apt-repository ppa:mozillateam/ppa
    
    # Create a new file, it should be empty as it opens:
    sudo gedit /etc/apt/preferences.d/mozillateamppa
    
    # Insert these lines, then save and exit
    Package: firefox*
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 501
    
    # after saving, do
    sudo apt update
    sudo apt install firefox # or firefox-esr
    
    • 1
  2. NotTheDr01ds
    2022-12-11T09:31:44+08:002022-12-11T09:31:44+08:00

    System doesn't have a working snapd, skipping

    看起来你可以:

    • 使用较旧的 WSL2 版本
    • 或者还没有在 WSL2 上启用 Systemd

    通过启用我在此处的回答中提到的 Systemd 功能,WSL2 上的 Ubuntu 现在支持 Snap 。

    但是,请考虑您是否真的需要这个:

    • 正如我在那里的回答中提到的,启用 Systemd 会产生并不总是需要的额外开销。
    • Windows 版本的 Firefox 可能是更好的选择(除非您确实需要测试某些特定于 Ubuntu 或 Linux-in-general 的 Firefox 功能)。
    • 另一个答案中提到的 PPA 也是一个有效的替代方案。
    • 1

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve