If you’re using Debian, one of the most popular Linux distributions, you might need to check its version for troubleshooting, software compatibility, or general knowledge. Fortunately, checking the Debian version is easy, even for beginners. In this guide, we’ll walk you through the steps to check your Debian version using built-in tools and commands.
All of the methods given below should work on Debian and the Debian-based systems such as Ubuntu, Linux Mint, Pop!_OS, and Elementary OS etc.
Table of Contents
Why Check Your Debian Version?
Knowing your Debian version is important because:
- It helps you install the right software for your system.
- It ensures compatibility with applications and tools.
- It helps you follow the correct guides or tutorials for your version.
There are several simple methods to find out which version of Debian you’re using. Let’s explore the easiest ways to find your Debian version.
Method 1: Check the /etc/os-release
File
The /etc/os-release
file contains details about your operating system, including the Debian version.
To check the Debian version, run the following command from Terminal:
cat /etc/os-release
Look for the line that says VERSION_ID
or PRETTY_NAME
.
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
In this output,
VERSION_ID="12"
means you’re using Debian 12.PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
also confirms the version.
This method is quick and reliable.
Method 2: Check the /etc/debian_version
File
The /etc/debian_version
file directly shows the Debian version number.
To identify your Debian Linux version, run:
cat /etc/debian_version
The output will show the version number, such as 11.6
for Debian 11 or 12.9
for Debian 12.
This method is straightforward and gives you the exact version number.
Method 3: Use the lsb_release
Command
The lsb_release
command provides detailed information about your Linux distribution.
To view the version of your Debian machine, run:
lsb_release -a
Sample Output:
Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
Look for the Description
or Release
line. For example:
Description: Debian GNU/Linux 12 (bookworm)
tells you the version.Release: 12
confirms it’s Debian 12.
This method is user-friendly and provides clear information.
Method 4: Use the hostnamectl
Command
The hostnamectl
command shows system information, including the Debian version.
To know the Debian version, run the hostnamectl
command from your Terminal:
hostnamectl
Look for the line that says Operating System
.
Static hostname: mydebian Icon name: computer-desktop Chassis: desktop 🖥️ Machine ID: 2089fghg140fp41sdax4901loq1803vm3014 Boot ID: f558gei34jhw90gjky120fghj34ty109dggm61 Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.8.12-5-pve Architecture: x86-64 Hardware Vendor: Intel_R_ Client Systems Hardware Model: NUC11PAHi3 Firmware Version: ABCDEF486.0972.3812.0438.3489
In this output, Operating System: Debian GNU/Linux 12 (bookworm)
tells you the version.
This method is simple and provides additional system details.
Method 5: Use the apt
Command
You can also check the Debian version by looking at the base-files
package, which contains version information. Here’s how to use it:
Open the terminal, type the following command and press Enter:
apt show base-files
Sample Output:
Package: base-files Version: 12.4+deb12u9 Priority: required Essential: yes Section: admin Maintainer: Santiago Vila <sanvila@debian.org> Installed-Size: 349 kB Provides: base Pre-Depends: awk Breaks: debian-security-support (<< 2019.04.25), initscripts (<< 2.88dsf-13.3), sendfile (<< 2.1b.20080616-5.2~) Replaces: base, dpkg (<= 1.15.0), miscutils Tag: admin::configuring, admin::filesystem, admin::install, admin::login, role::app-data, suite::debian Download-Size: 70.8 kB APT-Manual-Installed: yes APT-Sources: http://deb.debian.org/debian bookworm/main amd64 Packages Description: Debian base system miscellaneous files This package contains the basic filesystem hierarchy of a Debian system, and several important miscellaneous files, such as /etc/debian_version, /etc/host.conf, /etc/issue, /etc/motd, /etc/profile, and others, and the text of several common licenses in use on Debian systems.
Look for the Version
line in the output. For example: - Version: 12.4+deb12u9
indicates Debian 12.
This method is useful if you’re familiar with package management.
method 6: Use the dpkg
Command
The dpkg
tool manages Debian packages. You can use it to check the version of the base-files
package, which reflects your Debian version.
dpkg-query -W base-files
Unlike the previous apt show
command, it will only display Debian version:
base-files 12.4+deb12u9
it is good for those who needs a concise output.
Method 7: Use the Fetch Utilities
The fetch tools such as neofetch or screenfetch will display complete system information in visual format along with the distribution's logo. Unlike the previous methods, these tools are useful to check the version details of any Linux distribution.
Install the fetch utilities first. They are usually available in the default repositories.
Install Neofetch:
sudo apt install neofetch
Install Screenfetch:
sudo apt install screenfetch
Once installed, run the fetch tool to show the complete system details.
neofetch
Or,
screenfetch
There are also so many other utilities and methods to a Linux system details. Please check the following guides for more details. These guides are suitable for all Linux distributions.
- Find The Linux Distribution Name, Version And Kernel Details
- How to find Linux System details using inxi
- Find Linux System Details Using Python
Conclusion
Checking your Debian version is easy, even if you’re new to Linux. You can use simple commands like cat /etc/os-release
, lsb_release -a
, or hostnamectl
to find your Debian Linux information you need. Choose the one that works best for you.
Whether you’re troubleshooting, installing software, or just curious, these methods will help you quickly identify your Debian version.
By following this guide, you’ll never have to wonder which version of Debian you’re using again.