Issue installing Firefox from Mozilla repo

Graphical Environments, Managers, Multimedia & Desktop questions.
Message
Author
User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Issue installing Firefox from Mozilla repo

#1 Post by Danielsan »

Hi guys,

I am trying to install Firefox from mozilla repo, but it fails:

Code: Select all

Errors were encountered while processing:
 firefox
E: Sub-process /usr/bin/dpkg returned an error code (1)
I believe that it depends by this:

Code: Select all

apt show firefox -a
Package: firefox
Version: 130.0~build2
Priority: optional
Section: web
Maintainer: Mozilla Releng <release@mozilla.com>
Installed-Size: 257 MB
Provides: gnome-www-browser, www-browser
Depends: libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.18), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.5.12), libfontconfig1 (>= 2.11), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.1.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.37.0), libgtk-3-0 (>= 3.13.7), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0), libstdc++6 (>= 4.8), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxi6, libxrandr2 (>= 2:1.4.0), libxrender1
Download-Size: 70.6 MB
APT-Manual-Installed: yes
APT-Sources: https://packages.mozilla.org/apt mozilla/main amd64 Packages
Description: Mozilla Firefox
The package
libgcc1
doesn't exist with this name, as a matter of fact:

Code: Select all

apt install libgcc1 -s
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libgcc-s1' instead of 'libgcc1'
libgcc-s1 is already the newest version (12.2.0-14).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Conf firefox (130.0~build2 namespaces/moz-fx-productdelivery-pr-38b5/repositories/mozilla:mozilla
Fixing doesn't work either:

Code: Select all

apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up firefox (130.0~build2) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
dpkg: error processing package firefox (--configure):
 installed firefox package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 firefox
E: Sub-process /usr/bin/dpkg returned an error code (1)

Code: Select all

dpkg --configure -a
Setting up firefox (130.0~build2) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
dpkg: error processing package firefox (--configure):
 installed firefox package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 firefox

Code: Select all

aptitude install -f
The following packages will be REINSTALLED:
  firefox 
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
E: Internal Error, No file name for firefox:amd64
My system:

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
Thanks!

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1545
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 63 times
Been thanked: 90 times

Re: Issue installing Firefox from Mozilla repo

#2 Post by None1975 »

Why not just using flatpak? Or download binary from firefox web page and run it from home dir?

Image
OS: Debian 12.4 Bookworm / DE: XFCE
Debian Wiki | DontBreakDebian, My config files on github

User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Re: Issue installing Firefox from Mozilla repo

#3 Post by Danielsan »

I am going to use the binary again, but it was practical having the latest version provided through regular apt…

Flatpak? Never! 😤

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: Issue installing Firefox from Mozilla repo

#4 Post by sunrat »

I've had the binary installed but usually just use ESR as I have a lot of customisations. As a test, I just set up the Mozilla repo as instructed at https://support.mozilla.org/en-US/kb/in ... tributions and installed Firefox 130.0 on Bookworm. No problem and working fine.
It's the same version you are having trouble with so I have no idea why it's not working for you; are you using Bookworm?

Code: Select all

$ apt list firefox
Listing... Done
firefox/mozilla,now 130.0~build2 amd64 [installed]
The error appears to be this:

Code: Select all

update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
blackbird
Posts: 90
Joined: 2023-08-17 04:42
Has thanked: 3 times
Been thanked: 19 times

Re: Issue installing Firefox from Mozilla repo

#5 Post by blackbird »

I have the same problem. As far as I see the new firefox package has a postinst script which wants to register /usr/bin/firefox for update-alternatives. In the package data /usr/bin/firefox is a link to /usr/lib/firefox/firefox. After the package is extracted, the link /usr/bin/firefox exists as /usr/bin/firefox.real but there is no /usr/bin/firefox. Since the postinst script calls update-alternatives with the not existing file, it returns an error.

Searching in the internet for firefox.real gives findings where others have a script at /usr/bin/firefox which searches for firefox.real and starts this if it's existing and if not starts firefox-esr.

For me this looks like there was a mechanism to switch between firefox and firefox-est in earlier versions of Debian which is only partially removed. Maybe someone else knows more.

User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Re: Issue installing Firefox from Mozilla repo

#6 Post by Danielsan »

sunrat wrote: 2024-09-10 14:58 are you using Bookworm?
It is a fresh install just made on Sunday. I did not have this issue on the other laptop with Debian bookworm through dist-upgrade.
Maybe it belongs to "pure" Bookworm install.

:?

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: Issue installing Firefox from Mozilla repo

#7 Post by sunrat »

Danielsan wrote: 2024-09-10 22:14It is a fresh install just made on Sunday. I did not have this issue on the other laptop with Debian bookworm through dist-upgrade.
Maybe it belongs to "pure" Bookworm install.
Hmmm. My Bookworm is upgraded from Bullseye. I also set it up on a fresh Trixie install which works fine too. Indeed puzzling. You need to investigate the "update-alternatives" error; does /usr/bin/firefox actually exist?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
blackbird
Posts: 90
Joined: 2023-08-17 04:42
Has thanked: 3 times
Been thanked: 19 times

Re: Issue installing Firefox from Mozilla repo

#8 Post by blackbird »

The change of the firefox name to firefox.real comes from the Debian firefox-esr package. It uses dpgk diversions -> check "dpkg-divert --list".

I think this happens when firefox-esr is installed from the Debian repo, then the mozilla sources are configured with high priority. After that the old firefox-esr from Debian is overwritten with the new firefox-esr from Mozilla which doesn't do the diversion and also has no install script to remove this old diversion.

So removing the diversion with "dpkg-divert --remove" should be the easiest solution. I just installed firefox-esr from Debian repo and removed it again to solve this.

User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Re: Issue installing Firefox from Mozilla repo

#9 Post by Danielsan »

blackbird wrote: 2024-09-11 04:42 [...]So removing the diversion with "dpkg-divert --remove" should be the easiest solution. I just installed firefox-esr from Debian repo and removed it again to solve this.
I am not really understood what you wrote, anyway why on another installation (always Bookworm) did it work out and now it did not? :?

User avatar
blackbird
Posts: 90
Joined: 2023-08-17 04:42
Has thanked: 3 times
Been thanked: 19 times

Re: Issue installing Firefox from Mozilla repo

#10 Post by blackbird »

The firefox-esr package of Debian includes a script /usr/bin/firefox that calls firefox.real if available and firefox-esr if not. Also it has a preinstall script that tells dpkg to rename /usr/bin/firefox from other packages to /usr/bin/firefox.real.
If firefox-esr is installed vom Debian sources and then the Mozilla sources are added with higher priority, firefox-esr is overwritten with the package from Mozilla. This don't contains the /usr/bin/firefox script.
When firefox is then installed from Mozilla, the /usr/bin/firefox link is renamed to firefox.real with the rule in dpgk. Then the package wants to register the file /usr/bin/firefox to update-alternatives, but this file is missing.

To solve the issue you could call

Code: Select all

dpkg-divert --package firefox-esr --rename --remove /usr/bin/firefox
to remove the rename rule (this call is from the firefox-esr postrm script) and then try again installing firefox.

If the rule is removed with this can be checked with

Code: Select all

dpkg-divert --list
It's likely that in other installation, where it works, the rename rule is not there or the script from firefox-esr, from the Debian version, exists.

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: Issue installing Firefox from Mozilla repo

#11 Post by sunrat »

Sounds like a good explanation of the issue @blackbird . I wonder why it didn't affect Bookworm upgraded from Bullseye?
Here dpkg-divert --list includes the line

Code: Select all

diversion of /usr/bin/firefox to /usr/bin/firefox.real by firefox-esr
:? :?:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: Issue installing Firefox from Mozilla repo

#12 Post by sunrat »

I just noticed Firefox-ESR from stable repo was upgraded in today's upgrade from 115.15.0esr to 128.2.0esr . The menu entry changed from "Firefox-ESR" to "Firefox" meaning confusingly there were now 2 entries for "Firefox", one is 128esr and the other is 130 from Mozilla repo. Easy to fix with a quick edit of the menu, but I wonder if this may have some bearing on OP's problem? Probably not but just a thought.
Now that FF ESR has been upgrade to almost modern, I might just remove the Mozilla one and its repo. I'm seriously considering just switching to using Librewolf full-time anyway; it's more private than Firefox, has its own repo, and keeps up with current which is 130.0.3 atm.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Re: Issue installing Firefox from Mozilla repo

#13 Post by Danielsan »

I use LibreWolf daily on a SBC with Devuan instead of Debian and I can tell you that is leaner than Firefox-esr, besides this is still Firefox.

User avatar
blackbird
Posts: 90
Joined: 2023-08-17 04:42
Has thanked: 3 times
Been thanked: 19 times

Re: Issue installing Firefox from Mozilla repo

#14 Post by blackbird »

sunrat wrote: 2024-09-12 00:09 I just noticed Firefox-ESR from stable repo was upgraded in today's upgrade from 115.15.0esr to 128.2.0esr .
Please check if firefox-esr is really from Debian repo. I suspect you now did the upgrade from 115 Debian to 128 Mozilla. That would explain why the firefox install worked yesterday for you. If firefox-esr is now from Mozilla, the script /usr/bin/firefox should be removed.

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: Issue installing Firefox from Mozilla repo

#15 Post by sunrat »

blackbird wrote: 2024-09-12 06:05
sunrat wrote: 2024-09-12 00:09 I just noticed Firefox-ESR from stable repo was upgraded in today's upgrade from 115.15.0esr to 128.2.0esr .
Please check if firefox-esr is really from Debian repo. I suspect you now did the upgrade from 115 Debian to 128 Mozilla. That would explain why the firefox install worked yesterday for you. If firefox-esr is now from Mozilla, the script /usr/bin/firefox should be removed.
Good catch! Silly of me not to realise that, of course it's from the Mozilla repo. :oops: :lol:
Guess I'll keep it now, it's working well so far. Without any sciencing to confirm, it even feels a bit snappier.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Danielsan
Posts: 666
Joined: 2010-10-10 22:36
Has thanked: 9 times

Re: Issue installing Firefox from Mozilla repo

#16 Post by Danielsan »

Thank you guys, removing the "diverging" I was able to install Firefox although Bookworm decided to set Vivaldi as main x-www-browser and thus I had to reassign manually Firefox as default system browser... :?

User avatar
ramack
Posts: 504
Joined: 2008-01-28 15:31
Location: Centennial, CO
Has thanked: 6 times

Re: Issue installing Firefox from Mozilla repo

#17 Post by ramack »

blackbird wrote: 2024-09-11 20:21 The firefox-esr package of Debian includes a script /usr/bin/firefox that calls firefox.real if available and firefox-esr if not. Also it has a preinstall script that tells dpkg to rename /usr/bin/firefox from other packages to /usr/bin/firefox.real.
If firefox-esr is installed vom Debian sources and then the Mozilla sources are added with higher priority, firefox-esr is overwritten with the package from Mozilla. This don't contains the /usr/bin/firefox script.
When firefox is then installed from Mozilla, the /usr/bin/firefox link is renamed to firefox.real with the rule in dpgk. Then the package wants to register the file /usr/bin/firefox to update-alternatives, but this file is missing.

To solve the issue you could call

Code: Select all

dpkg-divert --package firefox-esr --rename --remove /usr/bin/firefox
to remove the rename rule (this call is from the firefox-esr postrm script) and then try again installing firefox.

If the rule is removed with this can be checked with

Code: Select all

dpkg-divert --list
It's likely that in other installation, where it works, the rename rule is not there or the script from firefox-esr, from the Debian version, exists.
Same issue and same resolution. Thank you!
homemade AMD64, Acer AspireOne 150, Asus eeePC 900, i386; Testing
i386,Dell Vostro 1000 AMD64, Dell Inspiron 1100; Sid
XFCE on all.

postcd
Posts: 165
Joined: 2022-01-08 18:33
Has thanked: 62 times
Been thanked: 3 times

Re: Issue installing Firefox from Mozilla repo

#18 Post by postcd »

Sorry for bumping this. Where to report this issue, so it can be fixed?

Above mentioned commands really helped to get rid of the error from the apt outputs.

$ sudo dpkg-divert --package firefox-esr --rename --remove /usr/bin/firefox
Removing 'diversion of /usr/bin/firefox to /usr/bin/firefox.real by firefox-esr'
$ sudo apt upgrade
...
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up firefox (131.0~build1) ...
update-alternatives: warning: alternative /usr/bin/firefox-esr (part of link group gnome-www-browser) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/gnome-www-browser is dangling; it will be updated with best choice
update-alternatives: using /usr/bin/firefox to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: warning: alternative /usr/bin/firefox-esr (part of link group x-www-browser) doesn't exist; removing from list of alternatives
update-alternatives: using /usr/bin/firefox to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
$ whereis firefox
firefox: /usr/bin/firefox /usr/lib/firefox /usr/share/man/man1/firefox.1.gz
$ whereis firefox-esr
firefox-esr: /usr/lib/firefox-esr /etc/firefox-esr /usr/share/firefox-esr
$ which firefox
/usr/bin/firefox
$ which firefox-esr
...nothing...
Deb.12 upgraded from Deb. 11, Kernel: 6.1.0-26-amd64 arch: x86_64, KDE.
Firefox from repo https://packages.mozilla.org/apt mozilla InRelease

I wanted to try returning from Firefox to Firefox-ESR, but older ESR does not accept modified newer Firefox profile, so I guess I will stay on latest Firefox.

Dude Guyman
Posts: 29
Joined: 2023-06-30 09:28
Has thanked: 4 times
Been thanked: 2 times

Re: Issue installing Firefox from Mozilla repo

#19 Post by Dude Guyman »

I've been running the ESR version as a portable app on Xfce, and have not had any problem that way. I just extract it to a "Portable" folder in my home directory and make a launcher in the Whisker "start" menu. Then set it as default and keep a backup of my "...user/.mozilla" profile folder.

currently: https://ftp.mozilla.org/pub/firefox/rel ... ux-x86_64/ and get the *language "firefox-128.3.0esr.tar.bz2" version.

alirezaimi
Posts: 145
Joined: 2011-01-12 16:25

Re: Issue installing Firefox from Mozilla repo

#20 Post by alirezaimi »

blackbird wrote: 2024-09-11 20:21 The firefox-esr package of Debian includes a script /usr/bin/firefox that calls firefox.real if available and firefox-esr if not. Also it has a preinstall script that tells dpkg to rename /usr/bin/firefox from other packages to /usr/bin/firefox.real.
If firefox-esr is installed vom Debian sources and then the Mozilla sources are added with higher priority, firefox-esr is overwritten with the package from Mozilla. This don't contains the /usr/bin/firefox script.
When firefox is then installed from Mozilla, the /usr/bin/firefox link is renamed to firefox.real with the rule in dpgk. Then the package wants to register the file /usr/bin/firefox to update-alternatives, but this file is missing.

To solve the issue you could call

Code: Select all

dpkg-divert --package firefox-esr --rename --remove /usr/bin/firefox
to remove the rename rule (this call is from the firefox-esr postrm script) and then try again installing firefox.

If the rule is removed with this can be checked with

Code: Select all

dpkg-divert --list
It's likely that in other installation, where it works, the rename rule is not there or the script from firefox-esr, from the Debian version, exists.

Thanks, work for me .

Post Reply