Hi,
I want to upgrade my linux box with a new kernel.
how do I do that?
Linux update/install new kernel
Re: Linux update/install new kernel
Well most of the time your linux flavor has some automatic upgrade tools.
gentoo : emerge
debian/ubuntu : apt-get
I recommend you use those.
But if you want to do it manually,
you can download the latest kernel from https://www.kernel.org/
Extract it to /usr/src
/usr/src holds all the "source" files.
I always create a symbolic link linux to the current version (I have several version of linux kernels)
You need a complier gcc. Make sure it is installed.
Configure Kernel
You need to configure the kernel so it has everything to support your hardware.
This really depends on your system and is unique to your system,
So I can't help you with that.
For most option you can choose to compile it in the kernel or as module.
Modules get only loaded when needed, so if you are not sure if you need an option, set it as module.
First go to the directory
Compile kernel
Now you can start to compile the kernel and the modules.
(This can take a while so use screen)
Install kernel
To install the kernel and the modules, you need to be root.
Alternative you can do it manually:
Create initrd image
Optional you can create a initrd image, some computers need it.
initrd images contains device driver which needed to load rest of the operating system later on.
Modify Grub configuration file (GRUB 0.97)
/boot/grub/grub.conf or if you use another bootloader, change that one.
I copy a section of the file and modify it. Just make sure it is the first section.
Or adapt default to the correct section (0 = first section)
Always leave, at least one old working kernel in boot.
So when the new kernel doesn't boot, (Which happened to me several times)
you can still boot by selecting a old kernel.
Now you can reboot your system to start using the new kernel.
gentoo : emerge
debian/ubuntu : apt-get
I recommend you use those.
But if you want to do it manually,
you can download the latest kernel from https://www.kernel.org/
Code: Select all
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.tar.xz
Code: Select all
tar -xjvf linux-3.10.tar.xz -C /usr/src
I always create a symbolic link linux to the current version (I have several version of linux kernels)
Code: Select all
ln -s linux-3.10 linux
Configure Kernel
You need to configure the kernel so it has everything to support your hardware.
This really depends on your system and is unique to your system,
So I can't help you with that.
For most option you can choose to compile it in the kernel or as module.
Modules get only loaded when needed, so if you are not sure if you need an option, set it as module.
First go to the directory
Code: Select all
cd /usr/src/linux-3.10
make menuconfig
Now you can start to compile the kernel and the modules.
(This can take a while so use screen)
Code: Select all
make && make modules
To install the kernel and the modules, you need to be root.
Code: Select all
su -
make modules_install
make install
Code: Select all
cp .config /boot/config-3.10
cp arch/x86/boot/bzImage /boot/vmlinuz-3.10
Optional you can create a initrd image, some computers need it.
initrd images contains device driver which needed to load rest of the operating system later on.
Code: Select all
cd /boot
mkinitrd -o initrd.img-3.10 3.10
/boot/grub/grub.conf or if you use another bootloader, change that one.
Code: Select all
nano /boot/grub/grub.conf
default 0
timeout 5
title Linux 3.10
root (hd0,0)
kernel /boot/vmlinuz-3.10 root=/dev/sda3
Or adapt default to the correct section (0 = first section)
Always leave, at least one old working kernel in boot.
So when the new kernel doesn't boot, (Which happened to me several times)
you can still boot by selecting a old kernel.
Now you can reboot your system to start using the new kernel.