To update packages on AlmaLinux, you can use the following commands with dnf
, which is the package manager for AlmaLinux (similar to CentOS and Fedora).
Basic Update Commands:
-
Update the Package List: This command refreshes the list of available packages and updates the system.
sudo dnf update
-
Upgrade the System: This will install the updates for all the packages that have new versions available.
sudo dnf upgrade
-
Check for Updates without Applying Them: If you just want to see what packages have updates available:
sudo dnf check-update
-
Update a Specific Package: If you want to update a specific package (e.g.,
nginx
), you can run:sudo dnf update nginx
-
Clean Cache: If you encounter issues with updating or if you want to clean up unused packages, you can clear the
dnf
cache:sudo dnf clean all
-
Reboot After Kernel Update (if necessary): If the kernel was updated, you might need to reboot the server to apply the changes:
sudo reboot
These are the basic commands to keep AlmaLinux packages up to date. If you're managing a server, it’s also a good practice to check regularly for security updates and ensure that key services (like the kernel) are updated promptly.