94

In a tutorial, I'm prompted "If you are running Squeeze, follow these instructions..." and "If you are running Wheezy, follow these other instructions..."

When I run uname, I get the following information:

Linux dragon-debian 3.2.0-4-686-pae #1 SMP Debian 3.2.63-2+deb7u2 i686 GNU/Linux

Is that information enough to know if I'm using Squeeze or Wheezy, or do I get that from somewhere else?

115

Commands to try:

cat /etc/*-release

cat /proc/version

lsb_release -a
- this shows "certain LSB (Linux Standard Base) and distribution-specific information".

For a shell script to get the details on different platforms, there's this related question.

  • It's funny you should ask, I just finished writing a related question which I share the outputs of those commands: What is the difference between all of these Debian version numbers? But sadly, none of the outputs say whether I'm using Squeeze or Wheezy. – IQAndreas Jan 3 '15 at 12:58
  • 3
    The last command you edited in (lsb_release -a) tells me it's Wheezy; perfect! – IQAndreas Jan 3 '15 at 13:02
  • @IQAndreas: Hmmm. It's weird that that you didn't also get that info from cat /etc/*-release on the DISTRIB_CODENAME line. OTOH, I'm not on Debian, I'm on a derived distro, Mepis 11. – PM 2Ring Jan 3 '15 at 13:06
  • @IQAndreas As tested on Debian Wheezy, all three provide the Debian version for me: (a) cat /etc/*-release shows Wheezy or, equivalently, version 7, on three separate lines; (b) cat /proc/version shows version number 7 in the suffix to the kernel build; and (c) lsb_release -a shows Wheezy on two lines and version 7 on a third. – John1024 Jan 3 '15 at 23:50
  • @John1024 "... shows version number in the suffix of the kernel build." - Ah, so that is what deb7u2 meant. From only glancing at it, I assumed it was the Git commit id. – IQAndreas Jan 5 '15 at 1:13
18

To get the exact version number use

cat /etc/debian_version
  • This does not answer the OP's question of the named version (e.g Wheezy or Jessie) – JoelAZ Oct 11 '17 at 4:25
  • 1
    This answer should be the preferred general answer because it works on distros derived from debian. lsb_release gives the debian version only on debian itself. On Ubuntu 18.10, cat /etc/debian_version gives buster/sid, which is the named debian version I expected. – Reece Feb 13 at 0:53
  • This one works in Ubuntu. – d a i s y Feb 20 at 8:30
1

david@asus:/usr/share/applications$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie) Release: 8.6 Codename: jessie

  • 4
    What new value does this answer bring compared to the accepted answer? – techraf Nov 13 '16 at 8:13
  • 1
    This answer is from a new user, who needs to learn how to write better answers or edit other ones to add useful information. – Edward Jan 3 '18 at 21:50
1
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.