remove unwanted kernels from Ubuntu 12.10

Asked by bostjanv

Hello,
I have some references to removing unwanted kernels from older versions of Ubuntu; however, they apparently don't apply to Ubuntu 12.10. The older instructions say "launch Synaptic package manager; search for linux-image; etc. etc."; however, on my Ubuntu 12.10 I can't seem to find the Synaptic package manager. Can someone help?
Regards,
bostjanv

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
N1ck 7h0m4d4k15
Solved:
Last query:
Last reply:
Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1

Hi,

I created a GNU/Linux korn shell script called removekernel

Here are the contents of the removekernel script:

#!/bin/ksh

if [[ $1 == "" ]]; then
echo "No argument added after removekernel command"
echo "Please enter kernelversion to remove from your pc (for example: 3.5.0-20-generic) "
read KERNELVERSION

echo "Removing kernelversion $KERNELVERSION"
apt-cache search $KERNELVERSION|cut -d" " -f1|xargs sudo apt-get remove -y

else
echo "Removing kernelversion $1"
apt-cache search $1|cut -d" " -f1|xargs sudo apt-get remove -y
fi

The script above will allow you to remove previous kernel versions with ease.

After making the script removekernel executable, you can use it like this in the Terminal:

removekernel 3.5.0-20-generic

to delete the 3.5.0-20-generic kernel.

Watch out though: if you use the following command and you do not have any 3.2.0 kernels installed, then you wipe out ALL available Linux kernels:

removekernel 3.5.0

is VERY dangerous and should NOT be used :-)

Regards,

Mark

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

What is the output of :

lsb_release -a; uname -a; dpkg -l | grep linux-image

Thanks

Revision history for this message
Best N1ck 7h0m4d4k15 (nicktux) said :
#3

The easy way is to install a software to do the job for you. Ubuntu Tweak seems good.
If you want synaptic , you can install synaptic.

To install synaptic package manager open a terminal (CTRL+ALT+T) and do

sudo apt-get update
sudo apt-get install synaptic

Then you can find it by writing : synaptic
in Dash search.

Then you must find the "Installed" kernels and right click and "Full Remove" them.

If you want to install Ubuntu Tweak (this software is automatic and will remove automatically all the older kernels) do:

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Then open it and click on "Janitor". There you must tick the "Old Kernels" box and Done.

Thanks

Revision history for this message
bostjanv (bostjanv) said :
#4

Thanks. I suppose this is the simplest solution, giving one a good overview of what is going on. Regards, bostjanv

Revision history for this message
Poltiser (poltiser) said :
#5

It is a very good solution if you want to have compiz installed. UTweak install compizz automatically :-(
Otherwise it is for me only reason to use UTweak - in Xfce I miss janitor - other things are easy to control.
Best regards