Ubuntu is renowned for its stability. But between classic updates, kernel updates, system cleanups and version upgrades, it’s easy to believe that everything is up to date, when in fact many layers of the system are not. This guide gives you a complete method for updating Ubuntu 100%, whether you’re on Desktop or Server. Nothing is left out.
Update all Ubuntu software packages
Before thinking about changing versions or updating the kernel, it’s essential to start by updating all the software packages already installed on your Ubuntu system. This includes libraries, applications, dependencies and system files provided by the official repositories. But beware: not all upgrade commands do the same thing, and some leave out important packages if you don’t go further than the classic apt upgrade.
Here’s a step-by-step guide to make sure that everything that can be updated actually is, without exception.
Classic update with sudo apt update && sudo apt upgrade
The most common way to update Ubuntu is to run :
sudo apt update && sudo apt upgrade
Here’s what each command does:
apt updatedownloads the list of available packages from the repositories configured in the system (but does not install anything).apt upgradeinstalls updates to packages already installed, provided that these updates do not require the removal or addition of new packages.
This method is safe, fast and avoids any risky modification of dependencies. But it can leave out some packages, those involving major deletions or replacements.
Frequent cases of “non-updated” packages
If you see this kind of message :
The following packages have been retained:
linux-image-generic grub-efi-amd64
This is because apt upgrade refuses to update them, as this would entail structural changes (such as replacing an old package or adding a new one). In this case, the system is not completely up to date, even if no errors are displayed.
Full upgrade with sudo apt full-upgrade
To go a step further and ensure that all packages are up to date (including those requiring deletion or replacement), we use :
sudo apt full-upgrade
This command :
- Updates all available packages
- Authorizes the installation of new outbuildings
- Accepts the removal of old or obsolete packages to allow a critical package to be updated.
This command also ensures that the linux-generic metapackage points to the latest kernel version available in the repositories.
Find out how to activate automatic updates on Ubuntu.
Checking and updating the Linux kernel on Ubuntu
While most users update their packages regularly, few know if their kernel is up to date or if they’re still running an obsolete version. Yet the kernel is the heart of the system, the link between your hardware and your operating system.
The Linux kernel is constantly evolving. With each new version, it brings :
- security patches for critical vulnerabilities
- improved hardware compatibility (recent devices, NVMe SSDs, Wi-Fi, etc.)
- improvements in performance, memory management and multi-core support
- new system features (such as support for filesystems or advanced modules).
Not updating your kernel exposes you to known vulnerabilities that have already been patched.
Install the latest kernel version from the Ubuntu repositories
On Ubuntu, the safest way to update the kernel is to use the following metapackage:
sudo apt install linux-generic
This package acts as a link to the latest stable kernel version available in your version of Ubuntu. It automatically updates :
linux-image-*: the kernel itself,linux-headers-*: files needed to compile modules.
⚠️ If your system is already up to date, this command will do nothing. But if you’re on an older kernel version (e.g. after a long freeze), it will install the latest available without risk.
Once the new kernel has been installed, you need to reboot your computer to load it at startup.
sudo reboot
After reboot, you can check with uname -r that the version corresponds to the latest one.
Cleaning up Ubuntu after the upgrade: free up space and avoid conflicts
Once all packages have been updated and the Linux kernel installed, a final, often overlooked step is to clean up the system. Ubuntu retains a lot of useless files after updates: old dependencies, obsolete kernels, package caches… All this takes up space and can, in some cases, cause conflicts or slowdowns.
Here’s how to do a deep clean, without putting your system at risk.
Ubuntu has several commands dedicated to system maintenance.
Remove unnecessary dependencies and packages
sudo apt autoremove
This command identifies packages that have been installed automatically (as a dependency of other software) but are no longer in use.
This is the case for :
- older kernel versions,
- orphan libraries,
- or former pilots who are no longer needed.
Cleaning the .deb package cache
sudo apt autoclean
This command removes from the cache all downloaded .deb packages that are no longer available in the repositories (old, obsolete).
And if you want to clean everything, even the packages that are still available :
sudo apt clean
apt clean empties the entire package cache, which is not always useful. In general, autoclean is sufficient and avoids re-downloading the same files at a later date.
Save disk space and avoid system conflicts
By default, Ubuntu maintains several kernel versions. After a complete update, the system may contain :
- the active (most recent) core,
- one or more old (backup) cores,
- their associated headers and modules.
On average, each complete kernel (image + headers) takes up 200 to 300 MB. If you never clean up, disk space can quickly become saturated on small /boot partitions.
sudo apt autoremove
This command identifies obsolete kernels (not used at startup) and proposes their safe removal.
Check if an Ubuntu upgrade is available
Ubuntu releases a new version every 6 months (April and October), but only LTS (Long Term Support) versions are maintained for 5 years.
Examples of LTS :
- Ubuntu 20.04 LTS (Focal Fossa)
- Ubuntu 22.04 LTS (Jammy Jellyfish)
- Ubuntu 24.04 LTS (Noble Numbat)
If you’re currently using an LTS version, Ubuntu will only automatically offer you the upgrade to the next one after the release of the version marked .1, such as 24.04.1 in our case. This precaution is designed to guarantee greater stability for professional and server users. However, it is possible to force early access if you wish to migrate earlier.
sudo do-release-upgrade --check-dist-upgrade-only
If the command doesn’t display an available version, this means either that you’re already on the most recent version, or that the new version is still being stabilized and is not yet offered by default.
Start the upgrade to the new Ubuntu version
Once your system is ready, you can start the migration to the next version.
Check that the tool is installed
The command-line update manager is provided by the update-manager-core package, which is usually present by default. If not, install it manually:
sudo apt install update-manager-core
Start Ubuntu upgrade
Once ready, run the following command to start the migration process:
sudo do-release-upgrade
⚠️ Note: Some third-party software or specific dependencies may not yet be compatible with the new version. In critical environments, we recommend testing the migration on a pre-production machine.
What happens during the upgrade:
- Software sources will be modified to point to repositories for the new version (e.g. from
jammytonoble). - Hundreds or even thousands of packages will be downloaded and automatically updated.
- The tool will ask you to confirm certain actions, such as replacing custom configuration files or removing obsolete packages.
- Finally, once all operations have been completed, the system will prompt you to reboot to fully apply the new version and load the new kernel.
Last step after reboot: finalize the update
Once the system has been restarted, it’s a good idea to run one last command to make sure everything is perfectly up to date:
sudo apt update && sudo apt upgrade
This will allow you to install any updates released since the migration (last-minute patches, translations, repository metadata, etc.).
