在 Ubuntu 23.04 上更新 Firefox snap 时出错

在 Ubuntu 23.04 上更新 Firefox snap 时出错

我想升级到 Ubuntu 23.10,但首先我需要安装所有可用更新,其中之一是 Firefox snap。本次更新失败。

sudo apt update && sudo apt upgrade
Hit:1 https://download.virtualbox.org/virtualbox/debian jammy InRelease
Hit:2 https://linux.teamviewer.com/deb stable InRelease
Hit:3 http://archive.ubuntu.com/ubuntu lunar InRelease
Hit:4 http://archive.ubuntu.com/ubuntu lunar-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu lunar-backports InRelease
Hit:6 http://archive.ubuntu.com/ubuntu lunar-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  xul-ext-ubufox
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  firefox
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/71.9 kB of archives.
After this operation, 250 MB disk space will be freed.
Do you want to continue? [Y/n] 
Preconfiguring packages ...
(Reading database ... 332187 files and directories currently installed.)
Preparing to unpack .../firefox_1%3a1snap1-0ubuntu3_amd64.deb ...
=> Installing the firefox snap
==> Checking connectivity with the snap store
==> Installing the firefox snap
2024-01-21T13:29:40+02:00 INFO cannot update "gnome-42-2204", will not have requ
ired content "gnome-42-2204": snap has no updates available
error: cannot perform the following tasks:
- Run hook connect-plug-host-hunspell of snap "firefox" (run hook "connect-plug-
host-hunspell": cannot perform operation: mount --rbind /dev /tmp/snap.rootfs_UD
gCG2//dev: No such file or directory)
dpkg: error processing archive /var/cache/apt/archives/firefox_1%3a1snap1-0ubunt
u3_amd64.deb (--unpack):
 new firefox package pre-installation script subprocess returned error exit stat
us 1
Please restart all running instances of firefox, or you will experience problems
.
Errors were encountered while processing:
 /var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我之前卸载了所有快照并禁用了快照,所以这可能是根本原因。

问题是:如何解决?我确实已经snapd安装了。

答案1

使用以下命令删除 Firefox:

sudo mv /var/lib/dpkg/info/firefox* /tmp
sudo dpkg --remove --force-remove-reinstreq firefox

升级您的 Ubuntu 版本,然后重新安装。

man dpkg:

reinstreq
   A package marked reinstreq is broken and requires reinstallation.
   These packages cannot be removed, unless forced with option
   --force-remove-reinstreq.

相关内容