Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Check Your CentOS Version

Six quick commands show which CentOS release your server runs.

VPS and Cloud Servers2 min read6 screenshots

Why check

  • To make sure you get the right security updates.
  • To check that software will work with your release.
  • To plan an upgrade.
  • To give correct details when you ask for support.

Connect to your server with SSH, or open a terminal on the desktop.

With the rpm command

rpm -q centos-release
Output of rpm -q centos-release

The version of the centos-release package is the CentOS version.

With hostnamectl

hostnamectl
Output of hostnamectl

It prints the operating system name and version, and a lot more.

With the os-release file

cat /etc/os-release
Output of cat /etc/os-release

Look at the lines NAME and VERSION.

With the centos-release file

cat /etc/centos-release
Output of cat /etc/centos-release

With the redhat-release file

CentOS is built from Red Hat Enterprise Linux, so this file exists too:

cat /etc/redhat-release
Output of cat /etc/redhat-release

With lsb_release

lsb_release -a

If the command is missing, install it with sudo yum install redhat-lsb-core. The output shows the distributor, description and release.

With the kernel version

uname -r
Output of uname -r

This shows the kernel version only. It points to the release but is less exact than the other ways.

With the desktop

On a CentOS desktop, open Settings, then Details or About.

Tip: To see the version of one package, run rpm -qi package_name.

Quick recap

  • cat /etc/centos-release is the fastest way.
  • hostnamectl and /etc/os-release give more detail.
  • Keep CentOS updated with yum or dnf.