Avatar of Taras Shumylo
Taras Shumylo

asked on 

cat /etc/debian_version returns stretch/sid instead of version

subject
LinuxLinux DistributionsOperating Systems

Avatar of undefined
Last Comment
Dan Craciun
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

So what is your question?

Try hostnamectl instead.

Or cat /etc/issue
Avatar of Taras Shumylo
Taras Shumylo

ASKER

I need that cat /etc/debian_version returns version of debian instead of stretch/sid or I need other way of knowing debian version.
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Tried the 2 suggestions above?
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

@Gerwin: /etc/issue is for Ubuntu. Does not work on Debian.
What's hostnamectl got to do with Debian version?


@Taras:
apt-get install lsb_release
lsb_release -a

Open in new window

Result:
Distributor ID: Debian
Description:    Debian GNU/Linux 7.9 (wheezy)
Release:        7.9
Codename:       wheezy

Open in new window



HTH,
Dan
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Hi Dan, about your remark:  /etc/issue is for Ubuntu. Does not work on Debian.

It does work on my Debian installation:

root@bpi ~ # cat /etc/issue
Debian GNU/Linux 8 \n \l

And Debian with systemd (https://wiki.debian.org/Debate/initsystem/systemd) has hostnamectl which (without parameters) will show hostname, OS etc.
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

You're right. Tested now in Debian 8 and it works.

I've stuck with Debian 7 for my VMs. Don't feel the need for systemd yet...
Avatar of Taras Shumylo
Taras Shumylo

ASKER

I do not have root access to the system.
cat /etc/issue does return
Debian GNU/Linux stretch/sid \n \l

Open in new window

Avatar of Taras Shumylo
Taras Shumylo

ASKER

Running hostnamectl return
Failed to create bus connection: No such file or directory

Open in new window

Avatar of Taras Shumylo
Taras Shumylo

ASKER

What does this stretch/sid even mean?
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Taras Shumylo
Taras Shumylo

ASKER

That awesome man, thank you!
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

You're welcome. Glad I could help!
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo