December 15, 2019

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 Singh

Linux System Administrator | Entrepreneur | Founder Techmion. I have started my career as a Linux system Administrator after that quit my job to start something new that excites me and started a Tech Company in order to provide the best technology to my clients. My Company website link: https://www.techmion.com/ For Bulk, SMS-Marketing follows the link : https://www.pingsms.in/

View all posts by Vedant Singh →

Leave a Reply

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