Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by Radagast on Mon 6 Jun 2005 at 10:15
Most Linux users pride themselves on compiling their own kernels. However, not everyone wants to do all that work, so Debian has a number of precompiled kernels available as packages. This article describes how to install these precompiled kernels using the apt package management system, based on my own experiences upgrading from 2.2.x to 2.4.x.
I initially installed the Debian stable distribution (woody), which came with a 2.2.x kernel. When I later upgraded to the testing distribution (sarge), the 2.2.x kernel remained, even though kernel versions 2.4.x and 2.6.x are currently available. To determine which kernel you're currently using, look in the file /proc/version.
The newer 2.4 and 2.6 kernels have many significant improvements compared to 2.2. For me, one of the largest changes was that the 2.4 kernel has full plug and play support built in, and since I was having trouble getting my PnP sound card configured with 2.2.x, I hoped that installing 2.4.x would help. For more details on the specific changes in each kernel version, see Joseph Pranevich's Wonderful World of Linux series of articles:
To see which precompiled kernels are available for your distribution, go to Debian's package search page, limit the search to your distribution, and search for "kernel-image" in the package name. As an example, here's what's currently available for the testing distribution: search.
There are a lot of options ( currently 194 for the testing distribution). The first big decision is which kernel version you want; I decided to upgrade from the 2.2.x kernel I was using to the most recent 2.4 kernel.
The Debian kernel images come precompiled for most processor architectures Debian supports, so the next step is to choose the image that matches your processor (e.g., 386, 586, 686, K6, K7). Assuming you don't already know what's under the hood, you can do a few things to find out quickly:
- The file /proc/cpuinfo contains information on your processor.
- The command "lspci" reports information on everything connected to your PCI bus.
The information from those two sources, combined with the descriptions of each specific kernel package, should allow you to select the proper package. For me, the /proc/cpuinfo file reported that I had an AMD Athlon, and that the CPU family was 6, so I chose the K6 package (currently kernel-image-2.4.27-2-k6). The hard part was now over.
Once you know which package you need, use apt-get to install the kernel image, just as you would with any other package (e.g., "apt-get install kernel-image-2.4.27-2-k6"). The install script is very easy to understand; it started by telling me to add a line to my lilo.conf file, asked me if I wanted to create a link to initrd.img and install a boot block (I went with the default of yes for both), and ended by instructing me to run lilo. That was it. You may have to do different things if you're using another boot loader.
After running lilo and rebooting, I had a brand-new kernel. There were no problems, and everything seems to work just fine; I was even able to get my sound card to work.