30 July 2007

Tip: Lock Versions

So, after getting Nvidia's unsupported binary drivers, killing X, and compiling them, then blacklisting the bcm43xx driver for your Dell Broadcom 1390 wireless card, compiling a new version of Ndiswrapper, unzipping the Dell driver, and loading it into there (how I got my friend's new laptop going), you finally have your system working. Then what happens? A kernel update. Did you need that kernel update? Chances are, the answer is no. If you got all the hardware working, you probably don't need whatever added functionality the new kernel provides (2.6.20-16, for example, got Texas Instruments card readers working without compiling the drivers, such as with my script), so why install it then redo all your tweaks? You could sit there and remember to uncheck the kernel every time an update pops up, but what if you forget? Then either uninstall or remember to hit Esc on GRUB and pick the right one. Forget that. Just prevent the kernel update from coming through altogether.

Locking the version on a package prevents it from being upgraded. I'll show you two ways to do this. The first is to open a terminal and type: sudo aptitude hold linux-image-`uname -r` Those ` are backticks, usually located to the left of the 1/! key. For those who prefer to use GUIs, open Synaptic and scroll down to where the packages named linux-image- and then some numbers are. Find the one you are using (probably the highest number), and click Package > Lock Version.

Both of these will prevent the kernel from upgrading at all. So, when Gutsy's released, what do you do? OK, now you need to release those holds. Synaptic, that's no problem. Just uncheck it, do the upgrade, then make sure you lock version on the new one. For the command line one do sudo aptitude unhold linux-image-`uname -r`. Redo all your tweaks of course, and you're good to go.


Anonymous said...

Brilliant! Thank you! I've been looking for something like that but have never found it anything so simple. This still downloads the new kernel-headers if it finds any, but doesn't download the kernel-image, which is the main thing.

Anonymous said...

Excellent! This is exactly what I was looking for. I bought a Dell laptop w/ Ubuntu pre-installed and it worked great out-of-the-box. But one of these kernel updates killed the sleep function. A laptop that can't sleep is really just a small desktop.

The 'hold' will prevent apt from upgrading the kernel, but do you know how to prevent the new kernels from appearing in the gnome update manager?