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

Taras ShumyloAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
So what is your question?

Try hostnamectl instead.

Or cat /etc/issue
Taras ShumyloAuthor 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 Commented:
Tried the 2 suggestions above?
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

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

apt-get install lsb_release
lsb_release -a

Open in new window

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

Open in new window

Gerwin Jansen, EE MVETopic Advisor 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 ( has hostnamectl which (without parameters) will show hostname, OS etc.
Dan CraciunIT ConsultantCommented:
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...
Taras ShumyloAuthor 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

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

Open in new window

Taras ShumyloAuthor Commented:
What does this stretch/sid even mean?
Dan CraciunIT ConsultantCommented:
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:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Taras ShumyloAuthor Commented:
That awesome man, thank you!
Dan CraciunIT ConsultantCommented:
You're welcome. Glad I could help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.