Monday 26 October 2009

Installing Linux kernel headers for Amazon EC2 Ubuntu instances

When you play around with Ubuntu EC2 instances on AWS you might, at one point, stumble upon needing to install the Linux kernel headers to build some kernel module(s) from source. However, the standard Ubuntu repositories do not offer the -xen images used to build those AMI's:
# apt-get install linux-headers-`uname -r`
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package linux-headers-2.6.27-23-xen

You should try to use the Ubuntu EC2 PPA packages for the Xen kernels — e.g.  you may use the following:
# echo "deb http://ppa.launchpad.net/ubuntu-on-ec2/ppa/ubuntu YOUR_UBUNTU_VERSION_HERE main" >/etc/apt/sources.list.d/ubuntu-on-ec2.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9EE6D873
# apt-get update
# apt-get install linux-headers-`uname -r`

Don't forget to replace "YOUR_UBUNTU_VERSION_HERE" with your own Ubuntu flavour (hardy/intrepid).

No comments:

Post a Comment