Friday, June 4, 2010

Upgrade Desktop Kernel to a Server Kernel in Ubuntu

I experience the Ubuntu 10.04 server installer didn't install on my Server PC, even I used the Alternative seems doesn't work. But previous versions of Ubuntu works on my system. As the Alternative installers didn't work, I installed the Desktop installer and it works without problems. But the PC will be used as a server, and performance wise it is better to use the Server kernel than the generic one. What i did are these steps:

1. Check first the version of the kernel by typing at the console
# uname -r
you will get similar to this
2.6.32-21-generic
2. Check repository regarding the kernel image
# apt-cache search linux-image

note:
the result give different kernel images, and check the last word for different machine to use
-ec2 Linux kernel image for ec2 machines
-generic Generic Linux kernel image
-server Linux kernel image on Server Equipment
-virtual Linux kernel image for virtual machines
-preempt Linux kernel image for Low Latency Server

x86/x86_64 signify for a 64 bit architecture

example:
linux-image-2.6.32-22-preempt - Linux kernel image for version 2.6.32 on x86_64 linux-image-2.6.32-22-server - Linux kernel image for version 2.6.32 on x86_64 linux-image-2.6.32-22-virtual - Linux kernel image for version 2.6.32 on x86/x86 _64
3. To install the server kernel, I chose linux-image-2.6.32-22-server
# apt-get install linux-image-2.6.32-22-server


4. If you want to remove the generic image from step #
# apt-get remove linux-image-2.6.32-21-generic

Alternate you can use this, to display the all images currently installed and to be installed.
# dpkg --list 'linux-image*'
Then remove one by one
# apt-get remove linux-image-x.x.xx-generic

Caution! Be careful of what you remove. Ensure that you don’t remove your current kernel, or anything that is not a linux-image. It is possible to break Ubuntu if you remove the wrong kernel.
WARNING! These examples may result into unstable system if not executed with care. Do not remove the kernel the system is currently running.

To make it safe use the GUI

To remove old kernel versions, open up Synaptic Package Manager, found in the System > Administration menu.

When it opens up, type the kernel version that you want to remove in the Quick search text field. The first few numbers should suffice.

For each of the entries associated with the old kernel (e.g. linux-headers-2.6.32-21 and linux-image-2.6.32-21-generic), right-click and choose Mark for Complete Removal.

Click the Apply button in the toolbar and then Apply in the summary window that pops up. Close Synaptic Package Manager.

The next time you boot up your computer, the Grub menu will not contain the entries associated with the removed kernel version.

5. After cleaning up, you now update the grub menu. In order to detect your currently installed kernel image.
# update-grub2


No comments: