Pin down the oficial Firefox version in Ubuntu

Today, I'll write an article about a more complicated administration tool: APTs pinning.

What is pinning?



Pinning is used to prevent your Ubuntu system to upgrade a package to a higher version through its automatic update system.

Why do you want to prevent an update?


Well, maybe the newer version of an application isn't working the way you want to or is buggy and you prefer to use the older version.

In my example, this happened to me with Firefox. The version 3.5 that ships with the official Ubuntu repositories works perfect.
But as I enabled the Mozilla-Daily repository from Launchpad to install the better Thunderbird 3.0 (see my article about installing it), that same repository also holds a newer version from Firefox. So my system all the time tries to upgrade to the version from Launchpad, which works worse for me.

How could I prevent upgrading Firefox from that repository, but still be able to use and update my Thunderbird 3.0 package from that one?

Obtain list of priorities


After searching through several articles and forum post, finally I found the tool I needed to setup the pinning.
apt-cache policy
apt-cache policy firefox-3.5

Whereas the first command shows a list of all your enabled repositories and their priorities, the second one gives you information about a concrete package.

In my case it shows:
firefox-3.5:
Installed: 3.5.4+nobinonly-0ubuntu0.9.10.1
Candidate: 3.5.5+nobinonly-0ubuntu0.9.10.1
Version table:
3.5.6~hg20091129r26611+nobinonly-0ubuntu1~umd1~karmic 0
50 http://ppa.launchpad.net karmic/main Packages
3.5.5+nobinonly-0ubuntu0.9.10.1 0
500 http://archive.ubuntu.com karmic-updates/main Packages
500 http://archive.ubuntu.com karmic-security/main Packages
*** 3.5.4+nobinonly-0ubuntu0.9.10.1 0
100 /var/lib/dpkg/status
3.5.3+build1+nobinonly-0ubuntu6 0
500 http://archive.ubuntu.com karmic/main Packages

You can see the installed version is 3.5.4, there is a newer version 3.5.5 from the official Ubuntu repositories, and a newer version 3.5.6 from the Luanchpad repository.
Interesting to look at is the Candidate: line, which shows the version that will be installed next by the update mechanism. Normally, this would be 3.5.6, but in my case, I lowered the priority of the Launchpad repository to 50, which is lower than the default, so it is not selected any more.

You want to know how this is possible? Read on.

Use pinning to lower upgrade priorities


The trick lays inside the /etc/apt/preferences, use man apt_preferences to read more about it.
Just execute the following instruction:

sudo echo "Package: *
Pin: release o=LP-PPA-ubuntu-mozilla-daily
Pin-Priority: 50" > /etc/apt/preferences.d/Mozilla-Daily

## or if that doesn't work for you (tried it only on Karmic):
sudo echo "Package: *
Pin: release o=LP-PPA-ubuntu-mozilla-daily
Pin-Priority: 50" > /etc/apt/preferences

sudo apt-get update


How to obtain the correct values


Remember the apt-cache policy command? Searching its output, you find the information:
 500 http://ppa.launchpad.net karmic/main Packages
release v=9.10,o=LP-PPA-ubuntu-mozilla-daily,a=karmic,n=karmic,l=Ubuntu,c=main
origin ppa.launchpad.net

From the release line I just selected the o=LP-PPA-ubuntu-mozilla-daily, enough to clearly select which packages will be pinned.

After the apt-get update, you will not be troubled any longer by the firefox updates from that repository, but the thunderbird-3.0 updates will still show up, because it doesn't exist in the official repositories.

Troubleshooting


I run into some trouble and will share the solutions here as well.

Can't find the o=LP-PPA-ubuntu-mozilla-daily entry


This happened in one of my machines, so at the end I had to pin down the whole Launchpad repositories, not only the Mozilla-Daily one.
sudo echo "Package: *
Pin: origin ppa.launchpad.net
Pin-Priority: 50" > /etc/apt/preferences.d/Mozilla-Daily
sudo apt-get update


Firefox and/or xulrunner still update from Mozilla-Daily


That happens when some packages have been updated from the Mozilla-Daily repository before. You'll need to downgrade them to a version from the official repositories.
Here an example (find the correct version with the apt-cache policy command):
sudo aptitude install firefox-gnome-support=3.5.5+nobinonly-0ubuntu0.9.10.1

Speed-up Ubuntu Boot-up time

I found these really interesting instructions which can speed up Ubuntu's startup.

The updates include a new kernel and replaces sreadahead with superfast ureadahead. To install these updates, follow these simple steps:

Install instructions

  1. Open the "Software Sources" under System->Administration.
  2. Select the “Other Software” tab.
  3. Click the “Add…” button in the lower left-hand
  4. Type “ppa:ubuntu-boot” and hit the “Add Source”
  5. Allow the system to refresh the sources
  6. Run “Update Manager” under System->Administration
That’s it! It will install the new kernel and replace sreadahead with ureadahead. You’ll need to reboot twice to see the benefits. The first reboot allows ureadahead to profile your boot so it can do its magic.

See also corresponding project on Launchpad.

Screensaver for Ubuntu Karmic


Ubuntu Karmic by default has very few screensaver modules enabled.
If you're a fan of screensaver, then I recommend you the following extra packages with install you more the 300 new modules.

Install instructions


sudo aptitude -y install xscreensaver-data-extra xscreensaver-gl-extra rss-glx


By the way, the rss-glx package gives you the beautiful skyrocket screen saver.

Instrumentation tools for Ubuntu

If you are a developer, administrator or you just want to track down some malfunction of your system, then some of these tools can be very handy.

sysdig

sysdig is a open source, system-level exploration: capture system state and activity from a running Linux instance, then save, filter and analyze.
Think of it as strace + tcpdump + lsof + awesome sauce.

systemtap


SystemTap provides infrastructure to simplify the gathering of information about the running Linux system. This assists diagnosis of a performance or functional problem. SystemTap provides a simple command line interface and scripting language for writing instrumentation for a live running system.

htop


Htop is an ncursed-based process viewer similar to top, but it allows to scroll the list vertically and horizontally to see all processes and their full command lines.

ethtool


ethtool can be used to query and change settings such as speed, auto- negotiation and checksum offload on many network devices, especially Ethernet devices.

EtherApe


EtherApe displays network activity graphically. Active hosts are shown as circles of varying size, and traffic among them is shown as lines of varying width.

Bandwidth Monitor NG


Bandwidth Monitor NG is a small and simple console-based live bandwidth monitor.

dstat


Dstat allows you to view all of your network resources instantly, you can for example, compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput.

hping


hping3 is a network tool able to send custom ICMP/UDP/TCP packets and to display target replies like ping does with ICMP replies.

nast


nast is a packet sniffer and lan analyzer and can sniff in normal mode or in promiscuous mode the packets on a network interface and log it. Filters can be applied and the sniffed data can be saved in a separated file.

Install instructions


sudo aptitude install systemtap htop ethtool etherape bwm-ng hping3 nast
curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | sudo bash

Ubuntu Karmic 9.10

This weekend I reinstalled one of my laptops with the latest Ubuntu release.
I didn't upgrade, because this installation was still young, without lots of personal tweaks and I read somewhere that if you upgrade from 9.04 you will miss some things that aren't upgraded by default like
  • partition with ext4 filesystem
  • encription of your home directory
In this post I'll put my impressions.
  • Design: I like the new darker brown theme and the startup screen is so beautiful. Icons are much better designed as well.
  • Firefox is 3.5 now, and is really fast at startup. Faster than the 3.5pre I used for the last weeks.
  • Thunderbird 3.0 isn't included, only 2.x can be installed. That sucks!
  • Wine: You should install the beta release, programs run so much faster, especially the GUI painting speeds up.
  • A new harddisk tool is included, which gives easy access to Smart information (healthy state about your disk).
    But the partition editor isn't included by default, you'll have to install it by hand.
  • The new Ubuntu Software Center isn't that useful as I thought. Okay, it's better than the old Application Installer, but most of the software I still have to install from Synaptic as it can't be found in the other one.
  • The Ext4 file-system seems to be really fast, find and locate finish in a few seconds.

Profile Switcher Extension for Firefox

The ProfileSwitcher extension enables you to use several profiles in Firefox and Thunderbird.
So you could create a developer profile and install all programmer extensions (like Firebug, Web Developer toolbar, etc.).
But if you just want to navigate, you don't need them and loading all of them just slows down the startup time of Firefox. Just use another profile without them, with a different set of extensions.

From the extension's preferences, you can choose what to do when you launch another profile (close the one in use, don't close it, ask every time).

Install instructions


Unfortunately, this extension can't be found on Mozilla yet, so just download it from the home-page or use this link to download the recent one when this post was written.