In this tutorial, we will show you how to check the Debian version from the command line. As a system administrator, the first question you should ask yourself after getting a new Debian server to manage is what version of Debian am I running? The version of the operating system in use on our server is important as it is critical that we have all the latest updates to ensure that the server is secure. There are a few ways to check your VPS hosting is using what version of Debian. With the commands below you can choose one of them to find out which Debian version is running on your system.
Prerequisites
- A server running one of the following operating systems: Debian Linux.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Check Debian Version
There are several ways on how to check what version of Debian is running on your system. Below you can find multiple examples on how to determine Debian version.
- Method 1.
The first place to look for the Debian version is to look inside /etc/issue file. From terminal run command:
root@idroot:~# cat /etc/issue Debian GNU/Linux 9 \n \l
- Method 2.
root@idroot:~# cat /etc/debian_version 9.0
- Method 3.
To obtain a Debian release number check content of /etc/lsb-release
file:
root@idroot:~# cat lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9 (stretch) Release: 9 Codename: stretch
- Method 4.
Additional information regarding the Debian version can be found within /etc/os-release
:
root@idroot:~# cat /etc/os-release 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/"