How do i find out which Fedora version I'm running from the cli (not uname -a)?
33,231
Solution 1
On modern systems you should be able to look in /etc/lsb-release
mojo-jojo david% cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu karmic (development branch)"
This should be the LSB mandated way of finding out the distribution across different Linux distributions.
You should not rely on /etc/issue, as it is used for the login message, and someone might change it.
Solution 2
Even better, and *nixwide:
lsb_release -d
Solution 3
Please see:
- How do I find out what version of Linux is running?
- How do I find out the distro of a server?
- Determining type of Linux machine
Solution 4
I had to do
cat /etc/fedora-release
Author by
Zak
Updated on September 17, 2022Comments
-
Zak almost 2 years
I want to know if the box is Fedora Core 4 or Redhat 9, or CentOS, etc... not if it has Kernel 2.6.x
-
Roy Rico over 14 yearsthis won't be a reliable way of checking for the server version because any sysadmin can modify the contents of that file. I modify the /etc/issue and /etc/issue.net files to display the company name and legal notice (and explicitly remove the distro name & version info)(
-
Zak over 14 yearson centOS 5.3 that file doesn't exist, but the bin directory provides provides lsb_release as a command alternative
-
ACyclic over 9 yearslsb_release is not available on Fedora (21 Workstation) base image
-
Jeremy Hajek almost 9 yearsFrom the Wikipedia Linux Standard Base page: "The command lsb_release -a is available in many systems to get the LSB version details, or can be made available by installing an appropriate package, for example the redhat-lsb package on Red-Hat-flavored Linux distributions such as Fedora.[2]" en.wikipedia.org/wiki/Linux_Standard_Base
-
Federico Galli almost 7 yearslsb-release does not exist on fedora systems. The correct file is called system-release