?
Solved

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

Posted on 2016-08-16
12
Medium Priority
?
1,140 Views
Last Modified: 2016-08-17
subject
0
Comment
Question by:Taras Shumylo
  • 5
  • 4
  • 3
12 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41758005
So what is your question?

Try hostnamectl instead.

Or cat /etc/issue
0
 

Author Comment

by:Taras Shumylo
ID: 41758010
I need that cat /etc/debian_version returns version of debian instead of stretch/sid or I need other way of knowing debian version.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41758026
Tried the 2 suggestions above?
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 35

Expert Comment

by:Dan Craciun
ID: 41758409
@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
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41758471
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.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 41758498
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...
0
 

Author Comment

by:Taras Shumylo
ID: 41759428
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

0
 

Author Comment

by:Taras Shumylo
ID: 41759431
Running hostnamectl return
Failed to create bus connection: No such file or directory

Open in new window

0
 

Author Comment

by:Taras Shumylo
ID: 41759433
What does this stretch/sid even mean?
0
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 total points
ID: 41759621
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."
1
 

Author Closing Comment

by:Taras Shumylo
ID: 41759659
That awesome man, thank you!
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 41759729
You're welcome. Glad I could help!
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question