Okay to autoremove these items? (Dec 28, 2022)

I just updated PureOS using the Terminal (sudo apt update/upgrade). Autoremove wants to remove the following packages:

linux-headers-5.10.0-14-amd64
linux-headers-5.10.0-14-common
linux-image-5.10.0-14-amd64

It is okay to remove these, right?

I’m assuming that it is okay since the linux kernel that was just installed is 5.10.0-20-amd64. I’m not sure why this is giving me pause, but it is.

As always, thank you for your help.

2 Likes

Yes, it is even preferable (boot partition needs some free space for future upgrades anyway). Just that first thing for myself, after brand new Linux Kernel upgrade, is:
sudo systemctl reboot

After you log in again:
sudo apt autoremove
sudo apt clean && sudo apt autoclean
sudo apt update

2 Likes

Autoremove removes dependencies that aren’t being depended upon anymore.

3 Likes

Yes.

Your general strategy should be that your computer has at all times:

  • the current running kernel version (the last installed)
  • the previous kernel version

and you allow any earlier kernel versions to be removed.

This is particularly the case if the rate at which new kernels are arriving is low - so the current kernel version gets a fairly comprehensive test in your environment and with your usage before it is replaced.

On the other hand, it is harmless to leave old kernels around for removal later on provided that your boot partition has enough free space, as @Quarnero also mentions. So if you are going to say “no” then you should do:

df /xxx

where xxx is the correct path for your boot partition, regularly, if not automatically.

3 Likes

Thank you! Also, thanks for sharing your process after a Linux Kernel upgrade. I’m going to update my “Updating Linux” notes with this process. :+1:

2 Likes