Finding Ubuntu or Debian version

If you’re running a Debian or Ubuntu distribution, there are different ways of finding the version that you’re running. We also have notes on how to find the version if you’re running Centos or RedHat

Finding running version of Ubuntu:

root# cat /etc/issue.net
Ubuntu 10.04.4 LTS

Shows the version of Ubuntu that I’m running “10.04.4 LTS”

root# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"

Includes “DISTRIB_CODENAME” which is the codename of this Ubuntu version.
Keep in mind that this file in not always available.

root# cat /etc/debian_version
squeeze/sid

Gives us the version of debian from which this Ubuntu was forked.

Finding running version of Debian:

root# cat /etc/issue.net
Debian GNU/Linux 6.0

Shows the major version of Debian that I’m running “6.0”

root# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.5 (squeeze)
Release: 6.0.5
Codename: squeeze

Shows more detailed information about the version.

root# cat /etc/debian_version
6.0.5

Shows the exact version of your running Debian installation.

Knowing the version of your OS is extremely helpful to keeping your server updated, or to install packages that are not included in the default repositories.

If you have more questions regarding Linux Administration, check out our services page!

Leave a Reply