Partition Resizing Plan

Liam Proven lproven at gmail.com
Thu Dec 12 15:52:41 UTC 2013


On 12 December 2013 11:51, Barry Premeaux <bpremeaux at gmail.com> wrote:
> I tried apt-get autoremove, but it didn't touch the kernels.  I have
> been doing several upgrades vs fresh installs.  I'll check it out.
> Thank you for the reminder.

Sadly, mostly, no it won't. It occasionally seems to decide to take
out a /really/ old one.

There are 2 ways. One is easier & uses the GUI.

The GUI way:

Find out the base version of your kernel -

uname -a

E.g. 3.11.0 for Saucy. This is followed by a hyphen and the build
number, e.g. `3.11.0-19`

Next, install Synaptic if you don't have it:

sudo apt-get install synaptic -y

Then run it:

gksu synaptic &

Now, enter the search term of the base version number, complete with
hyphen... e.g. `3.11.0-`

Sort the results by the "installed" column by clicking on the column header.

You will see that each kernel comes in 3 bits: kernel itself, initrd
and headers.

Now, carefully *don't* select the latest one, but select all 3 bits of
the previous version that's installed, then the one before that, then
any before that... Right-click the selection, pick "completely
remove", and then click Apply.

This can free as much as a gig or 2 of disk space.

The harder, command-line way is to identify what's current the same
way, with uname, then look what else is installed  with

ls -la /boot

... and then use

sudo apt-get remove linux-image-

At that point, press Tab to autocomplete with the kernel version, then
fill in the specific one you want to remove.

Then do it again but with

sudo apt-get remove linu-headers-

and again Tab to autocomplete and manually insert the full version and
build number.

You have to do both these commands for every old kernel you want to
get rid of. There may be half a dozen or more so it can take a while.

Be very very careful NOT to remove the one you are currently running
or your system will not boot.

I have also described the process here:
http://liam-on-linux.livejournal.com/20347.html

-- 
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Tel: +44 20-8685-0498 • Cell: +44 7939-087884




More information about the ubuntu-users mailing list