9

Maybe this is a stupid question.

I would like to know how do I know what is the version of my debian system.

Thanks a lot

2 Answers 2

14

Simply run "lsb_release -a" from the command line or "cat /etc/lsb-release"

2
  • 1
    Although lsb_release -a is much more informative, cat /etc/debian_version is another alternative.
    – mpy
    Aug 4, 2013 at 11:04
  • The lsb_release command is actually optional. See distribution specific files otherwise (/etc/debian_version, /etc/redhat-release ...) Aug 18, 2015 at 8:28
6

If you know that you are on a Debian or derivative, check the file /etc/debian_version. This will have the version number of the currently installed system.

If you want something more generic, look at (particularly) the PRETTY_NAME, NAME, VERSION and VERSION_ID values in /etc/os-release. This file is actually a shell script that you can source into your own scripts, to do things differently on different distributions.

On "true" Debian, both of the above are provided by the base-files package. Derivatives may be different.

Again if you know you are on a Debian system, you can also check the output of apt-cache show base-files to see which version of the base-files package is installed. This also might not work on Debian derivatives.

If you want to know the version of the kernel that is currently running, you can use uname for that. For example, uname -a to print all information, or uname -rv to print the specific kernel version with little extra information. In many cases, you should not need to do this, as what you do should not depend on the specific kernel version installed.

1
  • Note that this answer was originally posted to superuser.com/q/950410/53590, which was significantly edited after I posted the above answer.
    – user
    Aug 4, 2015 at 10:47

You must log in to answer this question.

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