We help IT Professionals succeed at work.

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

subject
Comment
Watch Question

Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
So what is your question?

Try hostnamectl instead.

Or cat /etc/issue

Author

Commented:
I need that cat /etc/debian_version returns version of debian instead of stretch/sid or I need other way of knowing debian version.
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
Tried the 2 suggestions above?

Commented:
@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
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
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.

Commented:
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...

Author

Commented:
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

Author

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

Open in new window

Author

Commented:
What does this stretch/sid even mean?
Commented:
It means you're on the testing branch (stretch, or Debian 9), possibly (but not necessarily) with unstable packages (from sid).

See the changelog here: https://sources.debian.net/src/base-files/9.6/debian/changelog/

"* Changed issue, issue.net, debian_version and os-release to read
    "stretch/sid", and dropped VERSION and VERSION_ID from os-release."

Author

Commented:
That awesome man, thank you!

Commented:
You're welcome. Glad I could help!