前言:
Ubuntu的snap方法和APT的安装方法,似有些冲突问题,这个问题也许是这个引起的。卡在snap Firefox不会动了 似乎比较常见。
可以实验如下解决方法:
修复[Ubuntu 22.04起仅提供snap版firefox] - 知乎 (zhihu.com)
但是,笔者是用了一个更简洁的方案,可见后文。
1 问题表征:
Errors were encountered while processing:
/var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu2_amd64.deb
22.04 Installation Hung at Firefox snap - Ask Ubuntu
1.1 安装gnome,报错:
donkeycar@DESKTOP-M4INDEG:~$ sudo apt install ubuntu-desktop
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ubuntu-desktop is already the newest version (1.481).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
gnome-core : Depends: firefox-esr (>= 78) but it is not installable or
firefox (>= 78) but it is not going to be installed or
chromium but it is not installable or
chromium-browser but it is not going to be installed or
epiphany-browser but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
1.2 然后,安装提示解决办法:
donkeycar@DESKTOP-M4INDEG:~$ sudo apt-fast --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
firefox
The following NEW packages will be installed:
firefox
0 upgraded, 1 newly installed, 0 to remove and 38 not upgraded.
1039 not fully installed or removed.
Need to get 0 B/72.3 kB of archives.
After this operation, 261 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 152631 files and directories currently installed.)
Preparing to unpack .../firefox_1%3a1snap1-0ubuntu2_amd64.deb ...
=> Installing the firefox snap
==> Checking connectivity with the snap store
==> Installing the firefox snap
2023-01-03T07:49:45+08:00 INFO failed to update "gnome-3-38-2004", will not have required content "gnome-3-38-2004": snap has no updates available
error: cannot perform the following tasks:
- Run configure hook of "firefox" snap if present (run hook "configure": cannot perform operation: mount --rbind /dev /tmp/snap.rootfs_oaypf1//dev: No such file or directory)
dpkg: error processing archive /var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu2_amd64.deb (--unpack):
new firefox package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
2 解决办法:快速,暴力:
$ sudo systemctl disable systemd-resolved.service
问题解决步骤来源于:
snap gets broken after first run #48
snap gets broken after first run · Issue #48 · DamionGans/ubuntu-wsl2-systemd-script (github.com)
3 解决办法3:
升级到新的GNOME的版本
Install gnome-3-38-2004 on Ubuntu using the Snap Store | Snapcraft
参考:
Systemd starts but services don't · Issue #47 · DamionGans/ubuntu-wsl2-systemd-script (github.com)