CentOS Stream 9, like its predecessor CentOS Stream 8, is a rolling-release distribution. This means it receives continuous updates, allowing access to newer packages and improvements earlier. However, to keep the system stable and secure, regular updates are necessary.
Below are the basic commands used to update CentOS Stream 9 systems along with explanations.
To update all packages on your system, use the following command:
dnf update -y
This command checks for available package updates, downloads, and installs them. The "-y" option automatically answers "yes" to confirmation prompts.
Alternatively, you can also use:
dnf upgrade -y
This command performs a similar function by upgrading all system packages to the latest versions.
If you want to update only a specific package, use:
dnf update package_name
For example, to update only the nginx package:
dnf update nginx
Kernel updates usually come bundled with the general system updates in CentOS Stream 9. After a kernel update, the system needs to be rebooted. You can reboot with:
reboot
To clean the package cache and free up disk space after updates, run:
dnf clean all
This removes unnecessary cached package files.
To list available updates without installing them, use:
dnf check-update
This command only displays which packages can be updated.
By running these commands regularly, you can keep your CentOS Stream 9 system up to date, fast, and secure. In server environments, automating these updates is considered good practice.
You have examined the knowledge base in detail, but if you cannot find the information you need,
Create a Support Ticket