Linux - How to know the version of the distribution (Operating system)

About

This article regroups all the way that you have to determine the version your distribution from a Linux software.

To determine the version of the kernel (ie Linux), the section has moved in an article: Linux - How to determine the version of the kernel ?

Distribution version

The distribution is also known as operating system.

hostnamectl

hostnamectl
Static hostname: cana.bytle.net
           Icon name: computer-vm
             Chassis: vm 🖴
          Machine ID: 35aeafa3d1364b24b986b7c18cc22b04
             Boot ID: 0e4d9a59532345b082f0194b220e3a38
      Virtualization: kvm
    Operating System: Fedora Linux 38 (Cloud Edition)
         CPE OS Name: cpe:/o:fedoraproject:fedora:38
      OS Support End: Tue 2024-05-14
OS Support Remaining: 7month 3w
              Kernel: Linux 6.4.12-200.fc38.x86_64
        Architecture: x86-64
     Hardware Vendor: OpenStack Foundation
      Hardware Model: OpenStack Nova
    Firmware Version: 2:1.10.2-58953eb7
       Firmware Date: Tue 2014-04-01

uname

uname -o

see Linux - Uname (unix name)

/etc/*release

Listing of the release files

ls -A1 /etc/*release

Output example for Centos:

/etc/centos-release
/etc/os-release
/etc/redhat-release
/etc/system-release

Output example for Fedora:

/etc/fedora-release
/etc/os-release
/etc/redhat-release
/etc/system-release

Other distribution release files:

  • /etc/SuSE-release
  • /etc/debian_version
  • /etc/slackware-version

Getting the version

  • Fedora
cat /etc/fedora-release
Fedora release 38 (Thirty Eight)

  • Enterprise Release
cat /etc/enterprise-release
Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)

  • Redhat (Centos) release
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
# or
CentOS Linux release 7.8.2003 (Core)

lsb_release

lsb_release -id

Output:

  • Oracle Linux
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)

  • Debian
Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.7 (squeeze)

/etc/issue

cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)
Kernel \r on an \m

The /etc/issue file should not be trusted, the file is intended as a text message to be displayed before login for telnet, or after the username has been entered with SSH. The issue file was never intended for storing a distribution version, the fact most distros put something there is merely coincidental branding (coz it's nice to have something in there)

A better indicator of the distribution is to 'echo /etc/*release'

dmesg

dmesg | head -1
Linux version 2.6.18-128.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) 
#1 SMP Wed Jan 21 07:58:05 EST 2009

Proc Version

cat /proc/version
Linux version 2.6.18-128.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44))
 #1 SMP Wed Jan 21 07:58:05 EST 2009

Documentation / Reference





Discover More
Card Puncher Data Processing
EBS - E-Business Suite 12.1.1 Standard Installation on Linux OEL 5.3

/appsutil/log/ /logs first line Oracle® E-Business Suite Installation Guide: Using Rapid Install Release 12.1 (12.1.1) Part...
Application Kernel Assembler Firmware Hardware
Linux - Distribution (Or Operating System)

Linux is an open source software and anyone can take it and create this own Linux (of distribution of Operating system). It's why you can find a lot of distribution on the market : Red Hat Oracle...
Linux - Directory /proc/sys/kernel/

This directory contains configuration files that directly affect the operation of the Kernel acct — Controls the suspension of process accounting based on the percentage of free space available...
Linux - Package Repository

A Package Repository is where OS package are stored. This repository are used by package manager such as yum to search and install packages With yum Output example: yum-config-manager dnf...
Linux - Uname (unix name)

uname (short for unix name) is a software program in Unix and Unix-like computer operating systems that prints the name, version and other details the current machine and the operating system running...
Card Puncher Data Processing
Linux / Unix

Linux is an open source software and anyone can take it and create this own Linux (of distribution). It's why you can find a lot of distribution on the market : Red Hat Oracle Enterprise Linux (which...
Oracle Database 11gr2 Typical Installation
Oracle Database - Installation 11g Release 2 (11.2) on Linux OEL 5 (X86)

Installation of Oracle Database 11g Release 2 (11.2) on Oracle Enterprise Linux 5. Linux OEL installation login as root RAM: At least 1 GB swap space The following table describes...
Linux Installation Optional Package Oracle Validated
Oracle Database - Oracle Validated Configuration RPM for a Linux Installation

The Oracle Validated Configuration RPM can be installed on servers using Red Hat Enterprise Linux or Oracle Enterprise Linux operating systems. It is available since 11.1 from the Unbreakable Linux Network...
Card Puncher Data Processing
Oracle Database - Prepare Storage for Oracle Automatic Storage Management on Linux

Prepare Storage for Oracle Automatic Storage Management Install the Linux ASMLIB RPMs to simplify storage administration. ASMLIB provides persistent paths and permissions for storage devices used...
Oracle Database Installationl Location 11gr2 Oel Linux X86 64
Oracle Database 11gR2 - Installation on Linux OEL 5 Update 5 (x86_64)

Installation of Oracle Database 11g Release 2 (11.2) x86_64 on Oracle Enterprise Linux 5 Update 5 on the file system (ie without ASM) or GRID. Linux OEL installation login as root ...



Share this page:
Follow us:
Task Runner