Showing posts with label Natty. Show all posts
Showing posts with label Natty. Show all posts

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.