Updated: 9 November 2026 · Applies to: Debian 13 (trixie, lsb-release 12.1-1) and Debian 12 (bookworm, lsb-release 12.0-1)
bash: lsb_release: command not found on Debian means the lsb-release package is not installed. Minimal installs, cloud images and containers leave it out. Install it as root with apt install lsb-release, or skip it entirely and read the version from /etc/os-release, which every Debian system has.
The error
Output on a fresh Debian 13 system:
bash: lsb_release: command not found
When you log in over SSH you may see it as -bash: lsb_release: command not found. It is the same problem. Scripts that call lsb_release -cs to find the Debian codename (for example to add a third-party repository) fail with it too.
Fix: install the lsb-release package
- Refresh the package list (as root, or put
sudoin front if your user has sudo rights):apt update
- Install the package. Note the hyphen in the package name; the command has an underscore:
apt install lsb-release
- Run the command again:
lsb_release -a
Output on Debian 13:
Distributor ID: Debian Description: Debian GNU/Linux 13 (trixie) Release: 13 Codename: trixie
Output on Debian 12:
Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
On current Debian the package is a small shell script that reads /etc/os-release, so it adds almost nothing to the system.
Useful lsb_release options
Print only one value, which is handy in scripts:
lsb_release -cs
lsb_release -rs
lsb_release -ds
Output on Debian 13 (one line per command above):
trixie 13 Debian GNU/Linux 13 (trixie)
-c is the codename, -r the release number, -d the description and -s short output without the label.
Alternative: read /etc/os-release (no package needed)
Debian, Ubuntu, AlmaLinux and Rocky Linux all ship /etc/os-release (we checked Debian 12 and 13, Ubuntu 24.04 and AlmaLinux 9). It is the standard place for this information, so it is the better choice for new scripts.
cat /etc/os-release
Output on Debian 13:
PRETTY_NAME="Debian GNU/Linux 13 (trixie)" NAME="Debian GNU/Linux" VERSION_ID="13" VERSION="13 (trixie)" VERSION_CODENAME=trixie DEBIAN_VERSION_FULL=13.7 ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
To use the values in a shell script, load the file and pick the fields you need. This replaces lsb_release -cs and lsb_release -rs:
. /etc/os-release echo "$VERSION_CODENAME $VERSION_ID"
Output on Debian 13:
trixie 13
For the exact point release, read /etc/debian_version:
cat /etc/debian_version
Output on our test systems: 13.7 on Debian 13 and 12.15 on Debian 12. Debian 13 also shows the point release as DEBIAN_VERSION_FULL in /etc/os-release; Debian 12 does not have that line.
Which should you use?
- A script or install guide asks for lsb_release: install
lsb-release. It is quick and safe. - You write your own script: use
/etc/os-release, so it also works on servers where nobody installed the package. - You only want to know the version once:
cat /etc/os-releaseis enough.
The minimal Ubuntu 24.04 image gives the same error and has the same fix (apt install lsb-release). AlmaLinux 9 does not include lsb_release either; there, /etc/os-release is the simplest choice. For more ways to check the version on any distribution, see how to find out what version of Linux you are running.
Official documentation: lsb-release package for Debian 13 and os-release manual.