How to install the newest firefox version on Debian 9?

5,537

1) Fix the "The following packages have been kept back ..." error.

Edit your sources.list as follow:

deb http://ftp.de.debian.org/debian/ stretch main
deb-src http://ftp.de.debian.org/debian/ stretch main

deb http://security.debian.org/ stretch/updates main 
deb-src http://security.debian.org/ stretch/updates main 


deb http://ftp.de.debian.org/debian/ stretch-updates main 
deb-src http://ftp.de.debian.org/debian/ stretch-updates main 

Removing Sid url which break apt.

Create (edit the content of the existing file) a /etc/apt/preferences file with the following contents:

Pin: release a=stable
Pin-Priority: 1001

Package: *
Pin: release a=stable-updates
Pin-Priority: 1001

Package: *
Pin: release a=proposed-updates
Pin-Priority: 1001

Package: *
Pin: release o=Debian
Pin-Priority: -10

Then run remove Firefox and reinstall its dependencies from stable:

apt update
apt purge --autoremove firefox
apt dist-upgrade

Some packages (maybe) need to be reinstalled manually through:

apt --reinstall install package

Please do not use apt remove or apt purge to remove them.

2) Installing the latest available firefox on debian: From apt the firefox package is an updated package but the version is 58.x (it is not an outdated package)

If you need to install the latest version you can use snap it is a safe way to install the latest firefox package.

apt install snapd

Check the available versions:

snap find firefox:

sample output:

firefox  60.0-2   mozilla    -      Mozilla Firefox web browser

Install firefox 60.0-2:

snap install firefox
Share:
5,537

Related videos on Youtube

Hagbard
Author by

Hagbard

Gimme... Gimme... Gimme... that badge. :-)

Updated on September 18, 2022

Comments

  • Hagbard
    Hagbard over 1 year

    I'm running Debian 9 and instead of the heavily outdated ESR version of Firefox shipping with this distribution, I would like to always use the most recent Firefox version.

    Thus, I changed my /etc/apt/sources.list file to the following:

    deb http://ftp.de.debian.org/debian/ stretch main
    deb-src http://ftp.de.debian.org/debian/ stretch main
    
    deb http://security.debian.org/ stretch/updates main contrib
    deb-src http://security.debian.org/ stretch/updates main contrib
    
    # jessie-updates, previously known as 'volatile'
    deb http://ftp.de.debian.org/debian/ stretch-updates main contrib
    deb-src http://ftp.de.debian.org/debian/ stretch-updates main contrib
    
    deb http://ftp.us.debian.org/debian/ sid main
    deb-src http://ftp.us.debian.org/debian/ sid main
    

    This worked fine for a while. However, I'm now getting the message

    The following packages have been kept back: firefox
    

    every time I run "aptitude upgrade firefox".

    Running the command "aptitude dist-upgrade" gives the following results:

    The following packages will be DOWNGRADED:
    libc-bin libc-dev-bin libc-l10n libc6 libc6-dev locales 
    The following packages will be upgraded:
    firefox{b} 
    1 packages upgraded, 0 newly installed, 6 downgraded, 0 to remove and 0 not upgraded.
    
    Need to get 51.2 MB of archives. After unpacking 12.0 MB will be freed.
    The following packages have unmet dependencies:
    firefox : Depends: libc6 (>= 2.27) but 2.24-11+deb9u3 is to be installed
           Depends: zlib1g (>= 1:1.2.11.dfsg) but 1:1.2.8.dfsg-5 is installed
    The following actions will resolve these dependencies:
    
     Keep the following packages at their current version:
     1)     firefox [59.0.2-1 (now)]                           
     2)     libc-bin [2.27-3 (now, unstable)]                  
     3)     libc-dev-bin [2.27-3 (now, unstable)]              
     4)     libc-l10n [2.27-3 (now, unstable)]                 
     5)     libc6 [2.27-3 (now, unstable)]                     
     6)     libc6-dev [2.27-3 (now, unstable)]                 
     7)     locales [2.27-3 (now, unstable)]                   
    Accept this solution? [Y/n/q/?]
    

    Thank you very much for any suggestions helping to solve this issue.

    // Edit: The output of "apt policy" is:

     100 /var/lib/dpkg/status
     release a=now
     500 https://riot.im/packages/debian stretch/main amd64 Packages
     release o=riot.im,a=testing,n=stretch,c=main,b=amd64
     origin riot.im
     2 http://ftp.us.debian.org/debian sid/main amd64 Packages
     release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=amd64
     origin ftp.us.debian.org
     500 http://ftp.de.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=stretch updates,l=Debian,c=main,b=amd64
     origin ftp.de.debian.org
     1000 http://security.debian.org stretch/updates/contrib amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=contrib,b=amd64
     origin security.debian.org
     1000 http://security.debian.org stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
     1000 http://ftp.de.debian.org/debian stretch/main amd64 Packages
     release v=9.4,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
     origin ftp.de.debian.org
     Pinned packages:
     fontconfig-config -> 2.13.0-5 with priority 1001
     libfontconfig1 -> 2.13.0-5 with priority 1001
     libnss3 -> 2:3.37.1-1 with priority 1001
     firefox -> 60.0.1-5 with priority 1001
    
    • Michael Homer
      Michael Homer almost 6 years
      Is the issue that you want to run newer Firefox, or that your Debian system is broken?
    • Hagbard
      Hagbard almost 6 years
      @MichaelHomer The former.
  • Hagbard
    Hagbard almost 6 years
    Thank you very much. That solved my issue. However, I had to add another "Package: *" line to your /etc/apt/preferences input. Could you please edit your answer accordingly? Another "issue" with this solution is that now all my bookmarks, settings and add-ons are gone. But that isn't too surprising given that I had to purge the firefox package first.