previous page: 109. How To Program XYZ Under Linux
page up: Linux FAQ
next page: 111. What Is a .gz File? And a .tgz? And .bz2? And... ?

110. How To Upgrade/Recompile a Kernel


This article is from the Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. Maintained by David C. Merrill with numerous contributions by others. (v1.0).

110. How To Upgrade/Recompile a Kernel

A: See the Kernel HOWTO or the README files which come with the kernel release on ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/ and mirrors. See Where Are the Linux FTP Archives?. You may already have a version of the kernel source code installed on your system, but if it is part of a standard distribution it is likely to be somewhat out of date (this is not a problem if you only want a custom configured kernel, but it probably is if you need to upgrade.)

With newer kernels you can (and should) make all of the following targets. Don't forget that you can specify multiple targets with one command.

 $ make clean dep install modules modules_install                            

Also remember to update the module dependencies.

 $ depmod -a                                                                 

This command can be run automatically at boot time. On Debian/GNU Linux systems, the command is part of the /etc/init.d/modutils script, and can be linked appropriately in the /etc/rcx.d/ directories. For more information on depmod, see the manual page.

Make sure you are using the most recent version of the modutils utilities, as well as all other supporting packages. Refer to the file Documentation/ Changes in the kernel source tree for specifics, and be sure to consult the README file in the modutils package.

Remember that to make the new kernel boot you must run lilo after copying the kernel into your root partition. The Makefile in some kernels have a special zlilo target for this; try:

 $ make zlilo                                                                

On current systems, however, you can simply copy the zImage or bzImage file (in arch/i386/boot/ to the /boot/ directory on the root file system, or to a floppy using the dd command. Refer also to the question, How do I get LILO to boot the kernel image?

Kernel version numbers with an odd minor version (ie, 1.1.x, 1.3.x) are the testing releases; stable production kernels have even minor versions (1.0.x, 1.2.x). If you want to try the testing kernels you should probably subscribe to the linux-kernel mailing list. See What Mailing Lists Are There?.

The Web site http://www.kernelnotes.org/ has lots of information and links to other sites that provide information about Linux kernel updates.

Also refer to the answers for, Why Doesn't My PCMCIA Card Work after Upgrading the Kernel? and How Do I Get LILO to Boot the Kernel Image?.

A: Alternatively, on Debian GNU/Linux systems, get a kernel source package from the Debian archive or from a Debian GNU/Linux CD. Then, follow the directions in the README file that is located in the kernel-package subdirectory.


Continue to:

previous page: 109. How To Program XYZ Under Linux
page up: Linux FAQ
next page: 111. What Is a .gz File? And a .tgz? And .bz2? And... ?