What's the difference between the Debian versions reported by uname vs what's in the file /etc/debian_version?

user@bldsvr:~$ uname -a
Linux sv-debbld-22 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
user@bldsvr:~$ cat /etc/debian_version
  • @Freddy - yes, it does; thank you.
    – StoneThrow
    Apr 27, 2021 at 4:14

2 Answers 2


While it may seem that it gives infos about the distribution, uname actually displays information about the running kernel. It can deceive you as on some (rare) virtualization env, guests machines can use the kernel of the host. You can see an ubuntu vm running a centos kernel..

/etc/debian_version is also deceptive as many distribution are based on debian and keeps this file, such as ubuntu.

The most reliable tool to get the distribution and it's version is lsb_release, though it's not always installed by default.

Installation instructions here (not my website): https://www.computerhope.com/unix/lsb_release.htm

Hope this helps


I am on Ubuntu.

mac2011-linux% cat /etc/debian_version 
mac2011-linux% uname -a
Linux mac2011-linux 5.8.0-50-generic #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021

I conclude that uname is more accurate.

  • not exactly, in bookworm : uname -a results in Linux cbb8b7e7e492 5.15.49-linuxkit #1 SMP Tue Sep 13 xx:xx:xx UTC 2022 x86_64 GNU/Linux Jan 6, 2023 at 17:28

Not the answer you're looking for? Browse other questions tagged .