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

1 - 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, the section has moved in an article: Linux - How to determine the version of the kernel ?

3 - Distribution version

The distribution is also known as operating system.

3.1 - /etc/*release

[[email protected] ~]# echo /etc/*release
/etc/enterprise-release /etc/redhat-release
[[email protected] ~]# cat /etc/enterprise-release
Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)
[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)

For other distribution release:

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

3.2 - 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)

3.3 - /etc/issue

[[email protected] ~]# 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'

3.4 - Others

login as: root
[email protected]'s password:
Last login: Sat Mar  6 22:39:34 2010 from 192.168.2.2
[[email protected] ~]# 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
[[email protected] ~]# 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

4 - Documentation / Reference

  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at del.icio.us
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Digg
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Ask
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Google
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at StumbleUpon
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Technorati
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Live Bookmarks
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Yahoo! Myweb
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Facebook
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Yahoo! Bookmarks
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at Twitter
  • Bookmark "Linux - How to know the version of the distribution (Operating system)" at myAOL
linux/version.txt ยท Last modified: 2017/01/24 12:12 by gerardnico