purge-old-kernels is superseded by "apt autoremove"

Bug #1686138 reported by Robie Basak
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
Fix Released
Medium
Dustin Kirkland 

Bug Description

Ubuntu works correctly to remove old kernels with "apt autoremove" now, so purge-old-kernels is superfluous. Is there anything that it does that "apt autoremove" does not which warrants keeping it? Otherwise, we should deprecate or drop purge-old-kernels, or perhaps leave an "apt autoremove" wrapper in its place.

Related branches

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

That would certainly be nice! I'd be delighted to deprecate purge-old-kernels.

However, the strange reality is that sometimes apt autoremove doesn't catch all of the kernels that should/could be removed.

And apt behaves badly when your disk is already full (often due to many gigs of of old kernels).

Changed in byobu (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Robie Basak (racb) wrote :

Judging from the open bug reports, purge-old-kernels also does the wrong thing in various situations currently.

To make progress, can I suggest a deprecation plan?

1) Mark purge-old-kernels as planned to be deprecated in Artful. Work as normal anyway, but note the planned deprecation to stderr, suggesting "apt autoremove" instead. Invite bug reports in that message (and state a location for them).

2) Address any bugs that get reported. At least this way we'll have open bugs for any problems in "apt autoremove", rather than the current situation where it is claimed to be problematic with no known bugs open.

3) After a period of time after no new reports, remove purge-old-kernels from the byobu in the development release (perhaps B or C).

4) I'm not suggesting any change to previous releases. purge-old-kernels will continue to work in 12.04, 14.04 and 16.04.

Revision history for this message
Robie Basak (racb) wrote :

3b) Before actually removing it, leave it in for a while but have it exit 1 with a message to stderr to use "apt autoremove" instead.

Changed in byobu (Ubuntu):
assignee: nobody → Dustin Kirkland  (kirkland)
status: Confirmed → Fix Committed
Revision history for this message
Robie Basak (racb) wrote :

Dustin,

Thank you for working on this! Some comments on your changes though:

1) Users will never see the deprecation message. And do we not want to make the change more gradually to protect against your concern that apt autoremove has edge case failures? And don't we want users to switch to running "apt autoremove" directly, so that we can drop the purge-old-kernels command entirely? In this case, shouldn't we be telling them about the wrapping?

2) Is apt the right package for the bugs? I think it's linux that provides the autoremove configuration for apt? I'd have to defer to the kernel team or look at the source to determine this for certain.

3) Are you running sudo twice there, since users will already be running it through sudo as instructed (and required) previously?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 5.117-0ubuntu1

---------------
byobu (5.117-0ubuntu1) artful; urgency=medium

  * usr/bin/purge-old-kernels, usr/share/man/man1/purge-old-kernels.1: LP: #1686138
    - deprecate the logic in purge-old-kernel, as apt autoremove is supposed
      to work properly now

 -- Dustin Kirkland <email address hidden> Sat, 18 Mar 2017 12:05:58 -0500

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Jarno Suni (jarnos) wrote :

Robie, 'apt autoremove' does not work, if there are broken packages in the system. And that usually is the case, if kernel updates have made /boot full. Even 'apt(-get) -f install' cannot deal with the space problem, as it tries to install something that does not fit. There are related bugs in other packages such as Bug #1678187, that may block removing kernels. Thus user have to take steps like described here:
https://help.ubuntu.com/community/RemoveOldKernels#Safely_Removing_Old_Kernels

Revision history for this message
Jarno Suni (jarnos) wrote :

The problem and my solution (linux-purge) is presented here https://youtu.be/gozw6A3qwCY
Subsequently I have published the utility at https://launchpad.net/linux-purge

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.