1

enter image description here

  • I want to clean disk space
  • Disk analyzer shows this graph
  • I noticed the repetitive pattern in /lib/modules (I guess old kernel versions)

How to determine obsolete kernels?

How to remove them safely?

Already tried sudo apt autoremove and sudo apt autoclean as described in this answer; these had no effect.

edit - why differs my question from the suggested duplicate: A simple solution like the one-liners I already tried would be nice, as I prefer a "user-friendly" way to work with my computer instead of using cryptic terminal-commands

Zanna
  • 72,312

3 Answers3

2

Get a list of all kernels that are installed on your Ubuntu:

dpkg -l "*linux-image-*" | grep ^ii

check which one of them you are running:

uname -r

Remove everything except the one which is in uname -r outputs:

sudo apt autoremove --purge linux-image ...
Ravexina
  • 57,256
1

Use /usr/bin/purge-old-kernels it's in the byobu package. purge-old-kernels handles the details (deleting all the parts of the old kernel, not deleting your current kernel, etc).

waltinator
  • 37,856
0

"I prefer a "user-friendly" way to work with my computer instead of using cryptic terminal-commands"

rm-kernels

rm-kernels fits your "user friendly" requirement. It's a bash script you can quickly create. As described in Ask Ubuntu answer: How to selectively purge old kernels all at once