+3 votes
244 views
How to know installed Linux distribution version

in Linux / Unix by (551k points)
reopened | 244 views

1 Answer

+4 votes
Best answer

1. Know what version of Linux I have installed with hostnamectl command
2. Know what version of Linux I have installed with the uname command
3. Know what version of Linux I have installed from Boot Time messages
4. Know what version of Linux I have installed with command / proc / version
5. Know what version of Linux I have installed with command / etc / issue
6. Know what version of Linux I have installed with command / etc / os-release
7. Know what version of Linux I have installed with lsb_release command

Due to administrative, audit or control tasks at specific times, it may be required that we have a clear edition and version of the operating system that we are using and for this purpose TechnoWikis will teach some practical commands for Linux operating systems and we will see that these are compatible with most The current distributions. When managing client computers with Linux operating systems it is ideal to know in detail what version and distribution is being used, this is essential to provide precise support or to install the appropriate applications and sometimes receive warranty from the developer..

We know that as new updates are released, new features are integrated or others are improved and for this reason it is essential to know with certainty which version is being executed since Linux, which is part of the UNIX family, can be Suse, OpenSUSE , Debian, Ubuntu, CentOS , Arch, Fedora, RHEL or some other.
TechnoWikis will explain various ways we can access this information effortlessly.


1. Know what version of Linux I have installed with hostnamectl command


The hostnamectl command can be used to query and modify the host name of the system and the configuration associated with it. The static hostname is stored in the path / etc / hostname.
Step 1

To confirm the version used we will execute the following:
 Hostnamectl 
In CentOS 7
In the case of CentOS 7 we will see the following: image
In Ubuntu
If we use Ubuntu we will see:

image


2. Know what version of Linux I have installed with the uname command


Uname (UNIX Name), is a command used to print information related to the Linux system.
Step 1

Some of the usage options are:
Command options
  • -a, –all: print all system information
  • -s, –kernel-name: print the kernel name
  • -n, –nodename: print the host name
  • -r, –kernel-release: print the system kernel release
  • -v, –kernel-version: print the kernel version of the distribution
  • -m, –machine: print the name of the team
  • -p, –processor: prints the processor type
  • -i, –hardware-platform: print the name of the platform
  • -o, –operating-system: prints the name of the operating system used
Step 2

To see the version used we execute:
 join me -r 
In CentOS 7
In CentOS 7: image
In Ubuntu
In Ubuntu:

image


3. Know what version of Linux I have installed from Boot Time messages


This option allows you to use the dmesg (diagnostic message) command which is a command in Unix operating systems that lists the kernel's message buffer.
Step 1

For its use we will execute the following:
 dmesg | head -1 
Step 2

The result will be as follows:

image


4. Know what version of Linux I have installed with command / proc / version


This file specifies the kernel version of the Linux system, the gcc version used to compile the kernel and the kernel compilation time. In addition, it also contains the username of the kernel compiler.
Step 1

When executing this command we will see the following in the terminal when executing:
 cat / proc / version 
On Ubuntu 17
image
In CentOS 7

image

In Linux Mint
image

5. Know what version of Linux I have installed with command / etc / issue


The / etc / issue file is a plain text file that can receive Escape sequences to insert information about the system used, some usage options are:
Command options
  • B: Insert the baud rate of the current line.
  • d: Insert the current date.
  • d: Insert the system name.
  • l: Insert the name of the current tty line.
  • m: Add the machine architecture identifier.
  • n: Insert the node name of the machine or hostname.
  • o: Insert the domain name of the machine.
  • A: Add the kernel version.
  • t: Insert the current time.
  • u: Add the number of currently connected users.
  • U: Insert the string "1 user" or "<n> users" where <n> is the number of users currently connected.
  • v: Insert the OS version

This method offers us the best results in the old Linux distributions, for this we execute:

 cat / etc / issue 
In Ubuntu
image
In Linux Mint
image

6. Know what version of Linux I have installed with command / etc / os-release


The / etc / os-release file contains identification data of the active operating system. The format of this basic os-release file is a list separated by new lines of compatible variable assignments to an environment and there we can obtain the configuration of the Shell scripts. The os-release file contains data defined by the operating system provider and as such should not be modified by the administrator as they may affect other additional services of the distribution itself.
Step 1

This is the most used method in modern Linux distributions, we will execute:

 cat / etc / os-release 
In Ubuntu
image
In CentOS

image

In Linux Mint
image
Step 2

In both cases we find specific details such as:
  • Distribution Name
  • Version used
  • System identifier
  • Name assigned by the developer
  • Developer website and more.

7. Know what version of Linux I have installed with lsb_release command


The lsb_release command prints information about LSB (Linux Standard Base) and distribution as such.
Step 1

Some of the parameters to use with this are:
Command options
  • -v, --version: Displays the version of LSB in which the distribution is compatible.
  • i, --id: Shows the distributor chain identification
  • d, - description: Generates a text description of a single distribution line.
  • -r, --release: Shows the version number of the distribution
  • c, --code me: Throw information with the code name according to the distribution used
  • a: Displays total system information
  • -h: Deploy LSB help
Step 2

For this we execute the following:
 lsb_release -a 

image

We can see that this last command displays much more information than the previous ones. That simple we can know in detail the version of Linux used..


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Sep 19, 2019 in Linux / Unix by backtothefuture (551k points) | 209 views
+3 votes
1 answer
+4 votes
1 answer
asked Oct 15, 2019 in Linux / Unix by backtothefuture (551k points) | 197 views
+3 votes
1 answer
asked Nov 2, 2019 in Linux / Unix by backtothefuture (551k points) | 246 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users