0

I have the same problem as this question, that is I get the warning:

The volume boot has only 0 bytes disk space remaining

on my Linux machine, version:

Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal

Now the solution seems to be to remove old kernels, but I want to make sure I do this in a safe way.
What I have done so far:

  1. Listed all of my kernels, with
    dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "\t" ";" | cut -d ";" -f1
    I have quite a few listed there.

  2. Used uname -r to see which kernel I am currently using which is: 5.15.0-101-generic

  3. Now looking to remove the old kernels this answer suggests running
    sudo apt-get autoclean && sudo apt-get autoremove

After using this command, one of the packages listed to be removed is
linux-objects-nvidia-470-5.15.0-92-generic
I know that you have to be careful with stuff related to the graphics card, as I have add to reboot my machine because of problems related to the graphics card.

Is linux-objects-nvidia-470-5.15.0-92-generic safe to remove?

Or is there a safer way to remove old kernels to clear space in the volume boot?

1 Answers1

1

You could remove your old kernels, but more efficient would be to reduce your logs.

sudo journalctl --vacuum-time=2d

would purge your logs until the last two days - a will free up some diskspace.

To remove old kernels, I have stashed an old script:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
kanehekili
  • 7,426