April 26, 2024

Detect what debian-based distribution you are working in

In this tutorial, I would like to talk to you about your Linux distribution and how you can find that in which distribution you were working on.

Just execute lsb_release -a.

On Debian:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux testing (stretch)
Release: testing
Codename: stretch

On Ubuntu:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty

In case when you don’t have lsb_release installed you may want to try some guessing, for example, there is a file
/etc/issue that often contains distribution name. For example, on ubuntu:

$ cat /etc/issue
Ubuntu 12.04.5 LTS \n \l

Don’t use file /etc/debian_version because its contents do not match the distribution name!

Note that this will also work on non-Debian-family distributions like Fedora, RHEL, or openSUSE — but that lsb_release may not be installed.

Vedant Kumar

Currently I'm working as an Implementation Engineer, Started my career as an System Administrator - Linux. Additionally loves to explore new technologies and research about new open-source software that ease the development cycle.

View all posts by Vedant Kumar →

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

close

Ad Blocker Detected!

VEDANT EXPLAINS
We've noticed that you are using an ad blocker. Advertising helps fund our server cost and keep it truly independent. It helps to build our content creator team. So please disable your ad blocker, and help us to keep providing you with free- great content - for free. Thank you for your support.

Refresh