Solved

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

Posted on 2016-08-16
12
107 Views
Last Modified: 2016-08-17
subject
0
Comment
Question by:Taras Shumylo
  • 5
  • 4
  • 3
12 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
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 37

Expert Comment

by:Gerwin Jansen
ID: 41758026
Tried the 2 suggestions above?
0
 
LVL 34

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 37

Expert Comment

by:Gerwin Jansen
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 34

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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 34

Accepted Solution

by:
Dan Craciun earned 500 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 34

Expert Comment

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now