Does (can) update manager remove unneeded files

Asked by dale francis

I am running 10.04. When update manager runs, it leaves files which might be unneeded such as linux-headers-2.6.32 and .33 .34 .35 .36 when doing .37 update. There are many other examples (many rather large). These seem to be earlier versions and possibly no longer needed.

Should they have been deleted?
Could they be deleted? If so, how?
What other files are left after an update which could be deleted? How do I find them?

Thanks for your help. I am running on a small capacity netbook ASUS eee900 and need all the space I can get.

JenCliff

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu update-manager Edit question
Assignee:
No assignee Edit question
Solved by:
Chris
Solved:
Last query:
Last reply:
Revision history for this message
Best Chris (fabricator4) said :
#1

Yeah, the EeePC can be a challenge, spacewise. I put an 8Gb SD card in mine and set it up to mount as /home. I then partitioned the 8GB SSD with 6.9Mb for / (root) and the rest for the swap partition. This give the / file system plenty of room, and a 1GB swap partition that will allow the machine to go into hibernation if I want. (Hibernate uses no power at all, since it saves the contents of RAM to the swap partition and powers off completely - it can stay like this indefinitely)

To answer your question, yes the old kernels will stay there. It's good idea to keep the last working kernel in case of the problems, but a few times a year you should delete any old kernels on the machine to make some space. To do this open synaptic package manager, click on "installed" in the pane on the left (only shows installed modules) then type 2.6.32 in the search box. All of the installed kernel modules for 10.04 LTS will now be displayed.

Double check which kernel you are booting by doing the following in a terminal window:

uname -r

It should be 2.6.32-37. You can now remove all of the old kernels before the -37 one. Yes they go in sequential order, -37 being the latest.

Next you should check the system for any un-needed dependancies that can be safely deleted. Again in a terminal windows:

sudo apt-get autoremove

You might be surprised by how many unneeded packages can be removed.

A couple of other things you can do if space is really tight: Remove any .deb installation files that have been downloaded (they are not needed after the install has been completed)

sudo rm -v /var/cache/apt/archives/*.deb

You can also remove any unwanted locale files which get installed by default. You have to be careful though - I only saved about 50MB and removing too much might be a problem. To do this there's a program you can install and run called localepurge:

sudo apt-get install localepurge

When you install the package it will ask you to mark all of the locales that you do _not_ want to remove, which it keeps in file /etc/locale.nopurge

The installer will then _run_ localepurge. I was happy doing this because I know I can re-install Ubuntu on this machine and have it updated in about 15 minutes, thanks in part to the separate /home on the SD card.
localepurge

Also consider deleting unwanted programs that you don't use. You have to be a little careful about what you remove. I use software center for this and look very carefully at what it says it's going to remove in the way of dependancies. If it tries to remove anything to do with "desktop", "Gnome", "Xorg" etc then proceeding is probably a _bad_ idea.

After removing unwanted programs you should probably run 'sudo apt-get autoremove' again.

Chris

Revision history for this message
dale francis (p-dale-p) said :
#2

Thanks Chris, that solved my question.