In this guide, I will teach you how to update the server. There are many reasons to ensure your server is up to date, including increased performance and efficiency, as well as enhanced security.
To begin, log into your CentOS server.

To update a single package, you can run the following command:
dnf update package_name
Type Y for yes when prompted, or add the -y flag to the command to assume yes.

To update all packages and assume yes, run the following command:
dnf update -y


After this is completed, it is best to reboot the system. On your lab server, this can be done at any time. If this was a work production system, you will want to ensure that this is scheduled during a maintenance window, and all necessary applications that need to be shutdown will be shutdown gracefully. To reboot, just run any of the following commands:
reboot
shutdown -r now
systemctl reboot
Note: If you just do 'shutdown -r', this will show a message stating the reboot will occur 1 minute from now, and the reboot can be canceled with 'shutdown -c'.

All done! Your server should now be back online and fully updated. Please note that this only applies to packages that are available within the repositories listed in /etc/yum.repos.d/ repo files.
Leave a Reply