This site is now 100% read-only, and retired.

Upgrading from the Linux Kernel 2.2.x to 2.4.x

Posted by Radagast on Mon 6 Jun 2005 at 10:15

Tags: none.

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.

 

 


Re: Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by Anonymous (147.197.xx.xx) on Tue 7 Jun 2005 at 11:17
`Most Linux users pride themselves on compiling their own kernels'? I seriously doubt that.

[ Parent ]

Re: Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by Anonymous (210.48.xx.xx) on Thu 9 Jun 2005 at 22:31
okay, most users who generally know what they are doing? (not counting gentoo of course)

[ Parent ]

Re: Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by Anonymous (70.177.xx.xx) on Fri 10 Jun 2005 at 06:15
I find it much easier to:

apt-cache showpkg kernel-image (or kernel-source)

which will show kernel images related to sources you have listed in /etc/apt/sources.list.

Then:

apt-get install *the image you want*

[ Parent ]

Re: Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by dbp (156.153.xx.xx) on Wed 15 Jun 2005 at 21:34
this is a great article. I was wondering if there is a similar article guiding debian newbies on how to upgrade from 2.4 to 2.6. I suspect that many who upgraded from woody to sarge will be interested in doing this. The sarge release notes actually adviced people using woody w/ 2.4 kernel to put off upgrading to 2.6 kernel as another project. I'd love to do this, but I'm a bit green - there appears to be topics that I have little clue about... e.g. udev, initrd, module handling...

[ Parent ]

Re: Upgrading from the Linux Kernel 2.2.x to 2.4.x
Posted by Anonymous (217.42.xx.xx) on Thu 29 Sep 2005 at 00:48
Agree, good article ... I've just upgraded an exact same box as described above, but would have preferred to upgrade to 2.6. However, there appears to be no K6 version of the 2.6 image, although there is a K7 one. What was so special about the 2.4 K6 image that meant that there was a special image for it, and why is there no K6 one?

Thanks!

[ Parent ]