Solved

Upgrading Kernel on Ubuntu 10.0.4 machine

Posted on 2012-03-23
4
749 Views
Last Modified: 2012-03-25
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
Comment
Question by:dan_ch
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
legolasthehansy earned 250 total points
ID: 37759404
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
 
LVL 10

Assisted Solution

by:pfrancois
pfrancois earned 250 total points
ID: 37760589
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
 

Author Comment

by:dan_ch
ID: 37761024
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
 

Author Comment

by:dan_ch
ID: 37762981
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provideā€¦
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now