[RESPONDED] Apt autoremove old kernels or no?

FW 13 using Ubuntu 22.04LTS on the recommended kernel

When running sudo apt update and then sudo apt upgrade I get this message in the terminal:

The following packages were automatically installed and are no longer required:
  linux-headers-6.5.0-18-generic linux-hwe-6.5-headers-6.5.0-18 linux-image-6.5.0-18-generic
  linux-modules-6.5.0-18-generic linux-modules-extra-6.5.0-18-generic
Use 'sudo apt autoremove' to remove them.

Being fairly new to linux, is that command something I should indeed be running?

You can remove any kernel you don’t need. To check your current kernel version run uname -r.

That command will free up disk space.

1 Like

The only downside is that, if you have any problems with the current kernel, you won’t have that older one to fall back on.

That said, I’ve been running Linux as my daily driver for seventeen years now, and problems requiring dropping back to an older kernel have been very rare. Don’t think I’ve had one in the last decade, so you’re probably safe doing so.

1 Like

The autoremove command will always leave at least one other kernel available for backup/faisafe. In case of real emergency though, you can always boot from a live USB stick and repaire the drives etc.

1 Like

You have a point. :slight_smile: I haven’t looked at that stuff in a good many years, didn’t remember that.

Hi @Tam welcome to the community,
It’s relative safe to use apt autoremove, but maybe still double check your custom grub entries before doing so.

cheers! :slight_smile: