Like all Linux distros, it’s important to keep your CentOS system up to date in order to make sure that you have the latest security updates and newest features. Updating the system usually involves simply upgrading all installed packages to their latest versions. Every few years, there’s a new version of CentOS released, which requires a more involved update process to install.
In this article, we’ll cover updating a CentOS system on a per package basis and upgrading the entire operating system. This can be done via command line and GUI. Both methods will be shown in this guide, so you can pick whichever is easier for you.
The process for upgrading a CentOS system is a little different depending on which version you have installed. The latest version of Centos has moved to the dnf package manager. Previous to Centos 8, yum was the package manager used. Regardless of which version you’re running, we’ll show you the proper commands so you can update your system.
Updating CentOS involves a few steps to ensure that your system is using the latest packages and security updates. Here is a step-by-step guide:
Update the Package Repository:
sudo yum check-update
Upgrade Packages:
sudo yum update
Reboot the System (if needed):
Some updates may require a system reboot, especially if the kernel or core system libraries were updated.
sudo reboot
Clean Up (optional):
After an update, you can clean up unnecessary files from the package cache to free up space.
sudo yum clean all
Verify Updates:
Ensure all updates have been applied and verify the current version of CentOS.
cat /etc/centos-release
Additional Tips:
- Regularly check for updates and apply them to keep your system secure.
- Use a tool like
yum-cron
for automatic updates. - Back up important data before performing major updates.
If you encounter any issues during the update process, you can refer to the CentOS documentation or seek help from the CentOS community forums.
How to Check my Current CentOS Version ?
To check the current CentOS version, you can use the following command in your terminal:
cat /etc/centos-release
This command will output something like:
CentOS Linux release 8.4.2105
Alternatively, you can use:
cat /etc/os-release
This will provide more detailed information about the operating system, including the version, like this:
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
Both commands will give you the information you need about your CentOS version.
wer