GutsySystemCleanup

Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

The release-upgrader will currently not remove unused kernels. This can lead to a certain amount of cruft on the system. This should be fixed in gutsy. Unused dependencies will be automatically removed too.

Release Note

The new cleanup features ensures that the system has no old unused software left.

Use Cases

Lapo has a system that he upgraded from warty. He has 8 unused kernels on his system. After the gutsy upgrade only the one or two that he really needs will installed, the others get removed as part of the system cleanup.

Scope

This specific cleanup will only run on release upgrades, not on regular (security) updates. Update-manager in regular update mode will never remove packages.

Design

We will only care for kernels that are part of the distribution. If the user installs kernels on his own we will not touch them. It will always keep the current running kernel to ensure that the machine is still bootable. All other kernels that are obsolete (no longer downloadable) will be marked for removal.

For the unused dependencies calculation the mechanisms inside libapt will be used. The removal will be part of the regular post upgrade cleanup process.

Implementation

This code will be added as part of the release upgraders postUpgrade cleanup. The current removal_blacklist.cfg will be changed to no longer include:

linux-image-.*
linux-restricted-.*
nvidia-glx.*

Instead those blacklist items (plus linux-ubuntu-modules-$ver) will be added dynamically based on the current running kernel version. This will ensure that the current kernel will be kept. The code will also ensure that local installed kernels will be not touched.

The algorithm that is used for the kernel removal works like this:

  1. get all obsolete/foreign packages before the upgrade
  2. get all obsolete/foreign packages after the upgrade
  3. all packages that are new obsoletes after the upgrade can be removed.

This algorithm will catch obsolete kernels from one release upgrade to the next.

A additional to this, a list is added with known old kernel package names to catch kernels that got obsoleted in earlier release upgrades. The above algorithm will not catch those as it does not know if the old packages were locally installed or leftovers from previous upgrades.

In addition to marking packages that are now obsolete for removal the new code will also mark unused dependencies for removal.

This spec makes the part "3.Unused left over kernels:" from https://wiki.ubuntu.com/SystemCleanUpTool obsolete.

Test plan

Perform a release upgrade and make sure to have at least one additional kernel installed. In the cleanup stage of the upgrade it should offer to remove that additional kernel.


CategorySpec

GutsySystemCleanup (last edited 2008-08-06 16:35:15 by localhost)