TL;DR
The current version of the Ubuntu GA kernel is 5.4-0-99
. You're currently having the version 5.4-0-96
. APT is recommending you to upgrade your kernel to the latest one (5.4-0-99
). apt autoremove
is suggesting you to remove the older version i.e (5.4-0-96
).
Let's take the package linux-headers-5.4.0-96
as an example for understanding it better.
linux-headers-5.4.0-96
is a kernel package, the kernel package are different from the normal packages.
Generally, normal packages like aptitude
and neofetch
do not change their names when they are upgraded. Unlike normal packages, kernel packages change their name when they're upgraded. For example, linux-headers-5.4.0-96
will change its name to 5.4.0-99
.
When a kernel gets upgraded, it comes in the form of a newer package instead of upgrading the older one. For instance, linux-headers-5.4.0-96
got upgraded to 5.4.0-99
. Here, the name of the package linux-headers-5.4.0-96
changed to the version 5.4.0-99
, thus, is considered as a different package by APT (Advanced Packaging Tool).
According to the developers and repositories, the package 5.4.0-99
is the upgraded version of linux-headers-5.4.0-96
, so APT is forced to install it but it does not remove the older version of the package i.e, linux-headers-5.4.0-96
.
So, APT is showing an upgrade is available for linux-headers-5.4.0-96
. It won't remove the older version of the package as described above.
So, apt upgrade
will upgrade the package to its newer version without removing the older one. But what about the older version of the package? Will it remain forever in your system? By default, Ubuntu keeps only the 2 latest kernels. If your system has more than 3 kernels or an obsolete kernel it would be removed by the apt autoremove
command.