+4 votes
375 views
Command to view and check CentOS version

in Linux / Unix by (552k points)
reopened | 375 views

2 Answers

+5 votes
Best answer

1. Check the Linux kernel version in CentOS
2. Check the CentOS version

Knowing exactly the version of our CentOS operating system is necessary for tasks such as:

  • Audits
  • Support and guarantee
  • Download the correct versions of updates
  • Control tasks
Normally we use our CentOS system to install hundreds of applications, but we do not have the exact certainty of which version we use , it is for this reason that TechnoWikis will explain some useful ways to know in detail the version of CentOS 7 and thus save this information for any administrative task .

1. Check the Linux kernel version in CentOS


This is the first step to take, it is necessary to know the version of the kernel or kernel, for this, we can execute any of the following commands:
 join me join me (Print all system information) 

image


2. Check the CentOS version


This same process applies to RedHat, and it is ideal to know that CentOS release version numbers are composed of two parts:
  • A main version like "6" or "7"
  • A minor or update version, such as "or 6.x" or "7.x".
To understand this a little more, for example, the CentOS 7.5 distribution has been built from the source packages of RHEL 7 update 5 which is known as the "point launch" of RHEL 7.
Check the CentOS version using RPM
The RPM (Red Hat Package Manager) command has been developed as a package management utility for Red Hat-based systems, such as CentOS or Fedora), so that with the rpm command, we will have the release version of CentOS, To do this we execute the following:
 rpm --query centos-release (CentOS) 
 rpm --query redhat-release (RHEL) 

image

Check the version using Hostnamectl
The hostnamectl command allows us to query and set the host name for Linux systems and to display other information related to the system itself, such as the release version of the operating system, to access this information we execute the following:
 hostnamectl 

image

Check the version using lsb_release
The lsb_release command is intended to display information from LSB (Linux Standard Base) and other distribution information. In CentOS / RHEL 7, the lsb_release command is provided in the redhat-lsb package, which we must install by running the following:
 sudo yum install redhat-lsb 

image

Once the package download is installed, we proceed to check the version information by executing the following:

 lsb_release -d 

image

Check version using Release Distro files
The above commands are responsible for retrieving information from the operating system version by taking several files from the operating system, it will be possible to view the contents of these files directly by using the cat command like this:
 cat / etc / centos-release (CentOS] cat / etc / redhat-release (RHEL) cat / etc / system-release cat / etc / os-release (Contains more information) 

image

With any of these options it will be possible to obtain the accurate version information in CentOS 7..


by (3.5m points)
edited
+4 votes

Which centos version do I have?

Which centos version do I have?

Whenever we have to make updates or install programs on servers it is essential to collect as much information as possible, especially to avoid failures or waste time, that is why we show you with a small command how to see the exact version on a Linux CentOS

1 - The command in question was run as root

# cat / etc / redhat-release

versesAnd another important fact, since it is, is to know if the system is 32 or 64 bits, I show you 2 ways to do it:

2 - The classic.

# join me

If it shows x86_64 several times after the date, then it is 64 bits, a 32-bit system should show i686 and i386 after the date. The date said by the way is the system installation .

3 - Directly to tell us 32 or 64 we do

# getconf LONG_BIT

by (552k points)
edited

Related questions

+5 votes
1 answer
asked Sep 22, 2019 in Linux / Unix by backtothefuture (552k points) | 278 views
+3 votes
1 answer
asked Oct 15, 2019 in Mac by backtothefuture (552k points) | 221 views
+5 votes
1 answer
+3 votes
1 answer
asked Nov 16, 2019 in Linux / Unix by backtothefuture (552k points) | 654 views
+5 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users