Friday, June 24, 2011

Downgrade to Firefox 3.6 on Ubuntu 11.04 Natty

We have a requirement in the office to downgrade to Firefox 3.6 on some test machines running Ubuntu Natty (11.04). To do this you can pin the firefox and firefox-branding packages to older packages from the Ubuntu Maverick (10.10) release.

Step 1: Edit your software sources to add Maverick
  1. Open your sources.list file:
    sudo gedit /etc/apt/sources.list

  2. Add the folowing three lines:
    # Maverick, used for firefox and firefox-branding 
    deb http://ftp.iinet.net.au/pub/ubuntu/ maverick main 
    deb http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates main

  3. Save and close the file

Step 2: Pin the packages firefox and firefox-branding
  1. Create the pin file for firefox:
    sudo gedit /etc/apt/preferences.d/firefox

  2. Add the following:
    Package: firefox
    Pin: release n=natty
    Pin-Priority: -10
    
    Package: firefox
    Pin: release n=maverick
    Pin-Priority: 900

  3. Save and close the file.

  4. Create the pin file for firefox-branding:
    sudo gedit /etc/apt/preferences.d/firefox-branding

  5. Add the following:
    Package: firefox-branding
    Pin: release n=natty
    Pin-Priority: -10
    
    Package: firefox-branding
    Pin: release n=maverick
    Pin-Priority: 900

  6. Save and close the file.

Step 3: Check your apt policy to make sure it worked
  1. Update your apt cache:
    sudo apt-get update

  2. Show the apt policy for firefox:
    sudo apt-cache policy firefox

    Sample output:
    sudo apt-cache policy firefox
    firefox:
      Installed: 5.0+build1+nobinonly-0ubuntu0.11.04.2
      Candidate: 3.6.18+build2+nobinonly-0ubuntu0.10.10.1
      Package pin: 3.6.18+build2+nobinonly-0ubuntu0.10.10.1
      Version table:
     *** 5.0+build1+nobinonly-0ubuntu0.11.04.2 900
            500 http://ftp.iinet.net.au/pub/ubuntu/ natty-updates/main i386 Packages
            500 http://ftp.iinet.net.au/pub/ubuntu/ natty-security/main i386 Packages
            100 /var/lib/dpkg/status
         4.0+nobinonly-0ubuntu3 900
            500 http://ftp.iinet.net.au/pub/ubuntu/ natty/main i386 Packages
         3.6.18+build2+nobinonly-0ubuntu0.10.10.1 900
            500 http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates/main i386 Packages
         3.6.10+build1+nobinonly-0ubuntu3 900
            500 http://ftp.iinet.net.au/pub/ubuntu/ maverick/main i386 Packages

    The line you are most interested in is "Candidate".
    This indicates the package that apt ranks as the installation candidate.

  3. Repeat this check for firefox-branding
    sudo apt-cache policy firefox-branding

Step 4: Install firefox 3.6
  1. Remove firefox 5.x:
    sudo apt-get remove firefox

  2. Install firefox 3.6:
    sudo apt-get install firefox

And you're done. Enjoy your outdated version of Firefox!


Update - July 24th 2011:

How to reverse the process:
  1. Remove these three (3) lines you added to /etc/apt/sources.list
    # Maverick, used for firefox and firefox-branding 
    deb http://ftp.iinet.net.au/pub/ubuntu/ maverick main 
    deb http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates main
    
  2. Unpin the firefox and firefox-branding packages:
    sudo rm /etc/apt/preferences.d/firefox
    sudo rm /etc/apt/preferences.d/firefox-branding
    
  3. Update your apt cache
    sudo apt-get update
    
  4. Install the latest Firefox:
    sudo apt-get upgrade
    
  5. Close ALL your Firefox windows and re-open Firefox.

Update - December 6th 2011:

From the comments people have posted below I can see that this process works to downgrade Firefox on Ubuntu 11.10 as well as Ubuntu 10.04.

Downgrading packages to the Ubuntu 10.10 release will only work on Ubuntu 11.04 or better. Do not use this procedure on Ubuntu releases older than 11.04. If you try to do this you will be upgrading packages not downgrading.

22 comments:

Alex M. Souza said...

Very nice. Thanks a lot.

I need it due some internal apps not working with firefox 5.

It worked just perfect.

Alan said...

Bookmarked! You da man!

Thx

Troy Test 1234 said...

Thanks Guys.
Glad this helped.

Nevparker said...

After completing the process sucessfully. I need to reverse it. Ho do I do it?

Thanks

Troy Test 1234 said...

Hi Nevparker,

To reverse the process:

1) Remove these three (3) lines you added to /etc/apt/sources.list

# Maverick, used for firefox and firefox-branding
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick main
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates main

2) Unpin the firefox package:
sudo rm /etc/apt/preferences.d/firefox

3) Unpin firefox-branding
sudo rm /etc/apt/preferences.d/firefox-branding

4) Update your apt cache
sudo apt-get update

5) Install firefox 5:
sudo apt-get upgrade

Nevparker said...

Perfect. Thanks. After downgrading I kept getting warning signs of add-on language packs which really slowed down the startup process.

I tried it because my wife really missed the little down arrow next to forward back to access very recent history. Maybe I'll have to find a different way to restore this button.

Thanks again

Troy Test 1234 said...

Nev,

I'd be interested to hear more about the error.

However, on a side note, to access the recent history in FF5 you just need to click and hold the back arrow.

Troy.

Anonymous said...

this is great.
I have to say that the latest 3.6 version of firefox is 3.6.19, while we are installing 3.6.18 (ok, this is really silly, I'm just wondering why...)

do you know what should I do to have Firefox 3.6 in Italian (or any other language different from english) ?

thank you very much

NavyJoe said...

Thank you, this process works like a charm!

dB. said...

Saved me. Ping back: http://code.dblock.org/unable-to-obtain-stable-firefox-connection-in-60-seconds-downgrading-firefox-on-ubuntu

Anonymous said...

Cheers for this I need to do this exact thing to test.

Anonymous said...

to get around the language pack thing I just deleted the offending files. and blew away my local .mozilla folder to remove any extension issues.

Panggi Libersa Jasri Akadol said...

i did the instruction above and i got FF 6 :( , how to make it to become 3.6 ? i need this version for selenium server ..


firefox:
Installed: (none)
Candidate: 6.0.2+build2+nobinonly-0ubuntu0.10.10.1~mfs1
Package pin: 6.0.2+build2+nobinonly-0ubuntu0.10.10.1~mfs1
Version table:
6.0.2+build2+nobinonly-0ubuntu0.10.10.1~mfs1 900
500 http://ppa.launchpad.net/mozillateam/firefox-stable/ubuntu/ maverick/main amd64 Packages
100 /var/lib/dpkg/status
3.6.22+build2+nobinonly-0ubuntu0.10.10.1 900
500 http://us.archive.ubuntu.com/ubuntu/ maverick-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ maverick-security/main amd64 Packages
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates/main amd64 Packages
3.6.10+build1+nobinonly-0ubuntu3 900
500 http://us.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick/main amd64 Packages

Troy Test 1234 said...

Hi Panggi Libersa Jasri Akadol,

You have the Mozilla stable PPA enabled. This provides the latest stable version of firefox (6). You need to disable this PPA in your software sources:

http://ppa.launchpad.net/mozillateam/firefox-stable/ubuntu/ maverick/main

Then run:
sudo apt-get remove firefox
sudo apt-get update
sudo apt-get install firefox

Then you will be back at Firefox 3.6.22

goku said...

firefox:
Installed: (none)
Candidate: (none)
Package pin: (not found)
Version table:
7.0.1+build1+nobinonly-0ubuntu2 -10
500 http://archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
3.6.23+build1+nobinonly-0ubuntu0.10.10.1 -10
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates/main i386 Packages
3.6.10+build1+nobinonly-0ubuntu3 -10
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick/main i386 Packages

sebastianresumil said...

Genio total, no tenes idea el tiempo que tarde en encontrar esto!! Gracias!

rajesh.battala said...

Thanks alot for the info

German - The Hombre said...

Thank you so much for the article. it worked like a charm.
Now, I need to reverse the process, and get the latest stable version of firefox. I know this was asked before, but I followed the instructions and they didn't work for me. I didn't get any error messages, but when I re-opened firefox, it was still 3.6.24. Am I missing something? Thank you in advance.

German - The Hombre said...

Thought I would add more info..
After trying to reverse it unsuccesfully, I decided to record the whole process, and maybe somebody can help me find what I'm missing.
I've ommited irrelevant information, or replaced it with "...", to reduce the size of this post.

$ firefox --version
Mozilla Firefox 3.6.24, Copyright (c) 1998 - 2011 mozilla.org

$ cat /etc/apt/sources.list
# Salimane Adjao Moustapha's Ubuntu Jaunty Jackalope 9.04 Sources list
#
# Repository List based on standard Jaunty with many extra packages
#
# If you get errors about missing keys, lookup the key in this file
# and run these commands (replace KEY with the key number):
#
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com KEY
# Ubuntu supported packages
deb http://archive.ubuntu.com/ubuntu lucid main restricted multiverse universe
deb http://archive.ubuntu.com/ubuntu lucid-updates main restricted multiverse universe
deb http://archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse
...
#firefox
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 632D16BB0C713DA6
# deb http://ppa.launchpad.net/fta/ppa/ubuntu karmic main # disabled on upgrade to karmic
# firefox 3.5 & 3.6
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE
# deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu karmic main # disabled on upgrade to karmic
#Ubuntu Mozilla Security Team
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A6DCF7707EBC211F
# deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu karmic main # disabled on upgrade to karmic
...


$ sudo rm /etc/apt/preferences.d/firefox; sudo rm /etc/apt/preferences.d/firefox-branding
rm: cannot remove `/etc/apt/preferences.d/firefox': No such file or directory
rm: cannot remove `/etc/apt/preferences.d/firefox-branding': No such file or directory

$ sudo apt-get update
...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo apt-get remove firefox
..
The following packages were automatically installed and are no longer required:
libexpat1-dev dbconfig-common libmysqlclient-dev libapr1-dev libaprutil1-dev
libpcrecpp0 libmcrypt4 libdb4.8-dev php5-mcrypt uuid-dev wwwconfig-common
libsqlite3-dev libpcre3-dev javascript-common libjs-mootools
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
firefox firefox-branding
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
..
Removing firefox ...
Removing firefox-branding ...

$ sudo apt-get update

$ sudo apt-get install firefox
The following extra packages will be installed:
firefox-branding
The following NEW packages will be installed:
firefox firefox-branding
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/13.0MB of archives.
Selecting previously deselected package firefox-branding.
..
Please restart all running instances of firefox, or you will experience problems.

$ firefox --version
Mozilla Firefox 3.6.24, Copyright (c) 1998 - 2011 mozilla.org

Troy Test 1234 said...

German - The Hombre,

What is the output of the following commands on your system:

1) ls -la /etc/apt/preferences.d/
2) sudo apt-cache policy firefox

I do not believe that these instructions will work on 9.04 Jaunty. The instructions are to DOWNGRADE a package. When you added a Maverick source to Jaunty you would have UPGRADE many packages. Not downgraded.

Podengo said...

rvp@rvp-sda8:~$ sudo apt-cache policy firefox
firefox:
Installed: (none)
Candidate: (none)
Package pin: (not found)
Version table:
9.0.1+build1-0ubuntu0.11.10.2 -10
500 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu/ oneiric-security/main i386 Packages
7.0.1+build1+nobinonly-0ubuntu2 -10
500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
3.6.24+build2+nobinonly-0ubuntu0.10.10.1 -10
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates/main i386 Packages
3.6.10+build1+nobinonly-0ubuntu3 -10
500 http://ftp.iinet.net.au/pub/ubuntu/ maverick/main i386 Packages
rvp@rvp-sda8:~$ lsb_release -a
LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
rvp@rvp-sda8:~$

Ruler2112 said...

I am currently trying to install Firefox 3.6.28 on Ubuntu 12.04. Followed the above directions and am getting the following. Any ideas?

W: Failed to fetch http://ftp.iinet.net.au/pub/ubuntu/dists/maverick/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ftp.iinet.net.au/pub/ubuntu/dists/maverick/main/binary-i386/Packages 404 Not Found

W: Failed to fetch http://ftp.iinet.net.au/pub/ubuntu/dists/maverick-updates/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ftp.iinet.net.au/pub/ubuntu/dists/maverick-updates/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Post a Comment