
If you have installed fresh Debian or updated version then it’s best to check version of Debian OS. In this tutorial, we will show you how to check OS version using different methods.
Types of Debian Releases
- Stable – This is the stable and official released by Debian. The latest Debian version is Debian 9 (stretch). So this release can be use for production server.
- Testing – This type of release can’t be use for production server. It contains packages with unstable version and updated frequently.
- Unstable – It is known as sid. Currently development version will be converted to Unstable.
Check Debian Version using Command Line
It is best practice to check version using command line as it is not depend on anything. So here we are going to check Debian version using lsb_release
(Linux Standard Base) utility. Commonly, this method is best because it will work regardless of any desktop environment or version you are using.
lsb_release -a
It will show output as below:
Output
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
From the above output you can see that Description line is showing OS version.
Instead of print all the details of your Debian system, you can simply print only distribution name by passing -d
with command:
lsb_release -d
The output should be similar like below:
Output
Description: Debian GNU/Linux 9.5 (stretch)
Check Debian Version using /etc/os-release file
os-release
file contains identification data of operating system and this available only with newer Debian distribution.
cat /etc/os-release
The output will be similar as below:
Output
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Check Debian Version using /etc/issue file
Like, os-release the /etc/issue
file also contains the system identification text. Using below command you can see it:
cat /etc/issue
It will show output as following:
Output
Debian GNU/Linux 9 \n \l
Check Debian Version using hostnamectl command
Mostly, hostnamectl command is used to set hostname in Debian systems but you also can check the system details using it. Execute below command:
hostnamectl
This command will work only for Debian 9 and newer versions. It should show output as below:
Output
Static hostname: local.tecnstuff
Icon name: computer-vm
Chassis: vm
Machine ID: 287b816ad03c4f429f7bb49501983e1c
Boot ID: 7fd5cca4dd5c41f6ac53214e11fa3f57
Virtualization: oracle
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.0-8-amd64
Architecture: x86-64
Like this, you can get your OS version using any one of these method.
Conclusion
Finally, you successfully learned how to check OS version using different methods. You can get more information on Debian releases at official site of the Debian Releases.
If you have any question or suggestion don’t forget to comment below.
Leave a Reply