[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 765
  • Last Modified:

Upgrading Kernel on Ubuntu 10.0.4 machine

Hello,

I have an Ubuntu 10.04.3 LTS machine (VM).  The Kernel is setting at: 2.6.32-33-server
When I ran the command to search for image upgrades (sorry can't remember the exact command)...something like this: ap search linux-image, there are a whole slew of images to upgrade to.  I was suggested that I update due to some security vulnerabilities as this is a public facing web server.

I have this on a VMWare environment, so I can easily take a snapshot and roll back if something breaks.

If you have a specific suggestion, I would appreciate that.   Also some straight forward  commands that I can use to update it would be much appreciated.

Thanks,
D
0
dan_ch
Asked:
dan_ch
  • 2
2 Solutions
 
legolasthehansyCommented:
It should be
aptitude search linux-image
and
aptitude safe-upgrade


See here
http://www.tcpdump.com/kb/os/linux/ubuntu-kernel-upgrade-procedure.html
0
 
Pierre FrançoisSenior consultantCommented:
First issue:
sudo aptitude safe-upgrade

Open in new window


After that, you need only to keep the most recent linux-image. First be sure to run the most recent one. If you reboot after the upgrade, normally, the most recent kernel will be loaded by default.

There is a shell oneliner command to remove all the older images but the current one:
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y remove 

Open in new window

This latter command will prevent you from multiplying unused kernels into your VM.
0
 
dan_chAuthor Commented:
Gentlemen,

Thanks for the responses.  So my question is that with these 2 commands below, with the "sudo aptitude safe-upgrade" command, must I also actually type the name of the image I want/need??

aptitude search linux-image

sudo aptitude safe-upgrade


This is a 64-bit Ubuntu OS.  Any suggestions as to which specific image would be a good image to load?

Thanks,
0
 
dan_chAuthor Commented:
Thanks guys for the help.  I went ahead and ran your commands as noted:
aptitude search linux-image
sudo aptitude safe-upgrade

Then ran this to remove image 2.6.32-33-server:

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y remove

Then per the link's instructions: sudo init 6

I am now safely upgraded to
linux-image-2.6.32-39-server

I'll accept both answers as they were both helpful!
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now