1

I went through Software Updater to upgrade from 20.04 to 22.04, but now dpkg(1) says the package system is broken:

firefox-locale-en: Depends: firefox (>= 1:1snap1-0ubuntu2) but 105.0+build2-0ubuntu0.20.04.1 is installed

It tells me to run "apt-get install -f", which yields:

The following additional packages will be installed:
  firefox
The following packages will be upgraded:
  firefox
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.

And then:

==> Installing the firefox snap
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 /home /tmp/snap.rootfs_sz424D//home: Permission denied)
dpkg: error processing archive /var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu2_amd64.deb (--unpack):

"apt --fix-broken install" fails the same way. Fine; I'll just remove firefox:

The following packages have unmet dependencies:
 firefox-locale-en : Depends: firefox (>= 1:1snap1-0ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

So firefox-locale-en has a broken dependency due to the wrong firefox installation. But I can't install the new firefox or remove the old one because of firefox-locale-en.

Any ideas on what to try next?

Thanks.

Terry

Artur Meinild
  • 26,018

2 Answers2

2

Attempt removal of the offending firefox packages using

sudo dpkg --remove --force-remove-reinstreq firefox-locale-en

IF that does not work, try substituting firefox in that command. Then run sudo apt update.

In the end, you should not have any .deb package of firefox installed. If you succeeded, you can install the snap package using sudo snap install firefox, or install the `.deb version directly from Mozilla.

vanadium
  • 88,010
  • Thanks for the replies.

    I used dpkg to remove firefox as suggested. "snap install firefox" wins the same "Run hook" error message as in the original post. Attempting the mount manually (as root) says the mount point does not exist (which indeed it does not -- the /home on the end does not exist).

    On the plus side, firefox is indeed no longer installed.

    – behindthecurve Oct 01 '22 at 15:52
  • I had to repeat this dpkg removal for multiple other .deb files aswell. I opted to remove firefox entirely and will go for a PPA instead of snap, – SSB Jan 14 '24 at 13:30
2

I got the same problem updating a laptop from 20.04 to 22.04.

The reason turned out to be that my /home directory was a symlink (to /u/home, where /u is a large data partition). I was able to solve the problem by:

  • Logging out as normal user
  • Logging in at a text console as root (requires setting a root password)
  • mv /home /home.old; mkdir /home
  • apt --fix-broken install
  • rmdir /home; mv /home.old /home

I'm not a fan of snap for several reasons - this just added a new one.