Results 1 to 8 of 8

Thread: What is the status of autoremoval of old kernels for 16.04

  1. #1
    Join Date
    Jan 2012
    Location
    Arizona
    Beans
    152
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    What is the status of autoremoval of old kernels for 16.04

    Hi, I'm an Ubuntu user since 2011 on a 64-bit AMD system I built. I usually upgrade to the latest LTS version and stick with it till the next. That means lots of kernel version updates along the way, which causes boot problems on my rig. I found out how to search & remove old kernel, header & image versions using Synaptic. It works great & helps a lot. I posted a thread about whether one could/should remove old Linux-Tools versions in 'General Help' but didn't get any useful responses. So I experimented and found I could remove older Linux-Tools in Synaptic without problems. That is the extent of my expertise in this area.

    My post here is to address the status of this issue in 16.04 development. If it's not already too late, it would be nice if the new version's updater could contain user-specified options for automatic removal of old kernels/headers/images/tools. Like if I could specify that all such older than the most recent two versions (current + a backup option) would be automatically, safely and completely removed from my system.

    I'm not knowledgeable enough to develop this feature myself, but would like to suggest it to the real heroes!

    Thanks, BlueAZ, USA

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,614
    Distro
    Ubuntu

    Re: What is the status of autoremoval of old kernels for 16.04

    I've moved this post to it's own thread.
    As the sticky posted into is for actual development news.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Jul 2013
    Location
    Wisconsin
    Beans
    4,952

    Re: What is the status of autoremoval of old kernels for 16.04

    Already included in the 16.04 version of unttended-upgrades (U-A).
    It defaults to on. The new feature asks aptdaemon for the list of orphans at the start and end of it's run. Any new orphans are removed by U-A before it terminates.
    This is different from U-A's existing autoremove, which remains and is still off by default.

    If you are not running 16.04 yet, you can simply enable U-A's existing autoremove.
    If you are running 16.04, you can enable still the existing autoremove, but probably won't see it do much because of the new feature.

  4. #4
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the status of autoremoval of old kernels for 16.04

    If it's not already too late,
    It is. If the developers have not already decided on doing something like this, then suggesting it now is months too late and this user forum is not the place to do it.

    I have been running 16.04 since the first few days of the start of its 26 week development cycle. It has received many kernel upgrades over the weeks and I think that there is at least another kernel upgrade to come. I have run autoremove once and it removed some old kernels. And apt-get upgrade right now informs me that there are 3 kernels that can be removed by running sudo apt autoremove.

    I do not have a separate boot partition. So, filling up /boot is not a problem for me. And I cannot test any automatic use of autoremove in a real life situation. So, the best advice I can give to anyone with a separate /boot partition (LVM & Encrypted installs? Yes?) is to regularly run

    Code:
    sudo apt autoremove
    Regards.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  5. #5
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: What is the status of autoremoval of old kernels for 16.04

    There is a bug that goes back to Trusty as well as Utopic, Vivid, Wily and Xenial 16.04. It even affected Mint 17 about autoremoving all kernels but one.
    This is wrong and 2 kernels are what is expected to be kept, one for backup.

    It has been stated by a developer (Jarnos) on the bug that it will eventually try to autoremove the one kernel you have left if allowed to do this.

    I filed the bug at ian-weisser's suggestion. Here is the thread where I started the discussion: http://ubuntuforums.org/showthread.php?t=2251168

    Here is the bug about /etc/kernel/postinst.d/apt-auto-removal wants to remove all kernels except the latest one: https://bugs.launchpad.net/ubuntu/+s...t/+bug/1440608

    Then there is the issue about when manually deleting a kernel or autoremoving it and the unnecessary need to reboot your system afterwards: https://bugs.launchpad.net/ubuntu/+s...x/+bug/1458204

    So, if keeping 2 kernels instead of just one is important sign on to the bug. Also, if you believe a reboot is unnecessary upon any kernel removal sign on to the other one.

    Also there is a cron job Jarnos added (from the bug) to perform an autoremoval at startup and a new /etc/kernel/postinst.d/apt-auto-removal file to replace the one you have.

    It works well and will allow keeping up to 3 kernels but no more than 3 as I tested that today and it wanted to autoremove the 4th kernel.

  6. #6
    Join Date
    Mar 2013
    Location
    Vermont USA
    Beans
    65
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: What is the status of autoremoval of old kernels for 16.04

    Quote Originally Posted by grahammechanical View Post
    It is. If the developers have not already decided on doing something like this, then suggesting it now is months too late and this user forum is not the place to do it.

    I have been running 16.04 since the first few days of the start of its 26 week development cycle. It has received many kernel upgrades over the weeks and I think that there is at least another kernel upgrade to come. I have run autoremove once and it removed some old kernels. And apt-get upgrade right now informs me that there are 3 kernels that can be removed by running sudo apt autoremove.

    I do not have a separate boot partition. So, filling up /boot is not a problem for me. And I cannot test any automatic use of autoremove in a real life situation. So, the best advice I can give to anyone with a separate /boot partition (LVM & Encrypted installs? Yes?) is to regularly run

    Code:
    sudo apt autoremove
    Regards.
    Is that a valid command? I only ask because I've always run
    Code:
    sudo apt-get autoremove
    to remove old kernels.
    Linux User #558289 - Learning as I go!

  7. #7
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,614
    Distro
    Ubuntu

    Re: What is the status of autoremoval of old kernels for 16.04

    Quote Originally Posted by BazBear View Post
    Is that a valid command?
    Yes it is.
    At least for 16.04
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  8. #8
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the status of autoremoval of old kernels for 16.04

    apt-get is the command line package management tool supplied with the Debian package apt. APT searches its cached list of packages and lists the dependencies that must be installed or updated.
    https://en.wikipedia.org/wiki/Advanced_Packaging_Tool

    When apt-get upgrade lists packages that are no longer needed it also advises to use apt autoremove to remove them. And it works as does apt-get autoremove

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •