Tools relying on /etc/debian_version get confused

Bug #19353 reported by Mark Brown
48
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

/etc/debian_version appears to be carried unmodified from Debian on Ubuntu systems.
This means that things like reportbug that use the information there to identify the
version of Debian that they are running on will identify Unbuntu systems as a Debian
version.

Another approach would be to modify all the tools like reportbug to add their own
information or read /etc/ubuntu_version and prefer that.

Revision history for this message
Colin Watson (cjwatson) wrote :

Ideally, tools should look at lsb-release first. The installer component
os-prober does this, for example.

It was beneficial to carry over /etc/debian_version, because that meant that
various system configuration tools automatically saw Ubuntu as a Debian
derivative (as opposed to looking for Red Hat-style configuration files, etc.).
Although we could probably get those modified in Ubuntu-specific ways now, I
think there's still enough stuff that tries to guess what flavour of GNU/Linux
is in use that it's beneficial to preserve the indicator of ancestry.

Revision history for this message
Mark Brown (broonie) wrote :

I wasn't suggesting removing the file, I was suggesting modifying it so that if something does
look at it it would be obvious that this isn't a vanilla Debian release.

Matt Zimmerman (mdz)
Changed in base-files:
status: Unconfirmed → Confirmed
Revision history for this message
Jergen Dutch (jergendutch) wrote :

I think the file *should* be removed

Ubuntu uses the file at the moment for two reasons:
 "..that various system configuration tools automatically saw Ubuntu as a Debian derivative.."

Reason 1: For tools to see Ubuntu as a Debian derivative
But Ubuntu Hardy is not the same as "lenny/sid", as reported by debian_version. It is misleading to pretend that it is. If they were the same, then Ubuntu wouldn't need to exist.

Reason 2: Marketshare/mindshare
Ubuntu is big and popular enough for tools to support Ubuntu. Relying on the (wrong) information that /etc/debian_version exists and therefore "this must be Debian" is dangerous and no longer necessary.

I've put a request for removal in bug 218646.

Revision history for this message
Mark Brown (broonie) wrote :

Jergen, I think you're missing the point here - /etc/debian_version is mostly for use by tools and lets them know that they're running on something that looks roughly like Debian. Given how close the Ubuntu infrastructure is to Debian it's still reasonable to assert that and removing the file completely isn't terribly constructive. Until MOTU gets vastly more manpower it's likely that things will remain like that.

As far as the actual text in /etc/debian_version goes, well, that's what this bug is about. Anything needing more detailed information than the fact that it's running on a Debian derivative is going to need to look at the text anyway.

Revision history for this message
Savvas Radevic (medigeek) wrote :

I firstly thought that it wasn't used anymore and it should be deprecated.
After reading the comments, well.. you are right, if tools require it, it is necessary :)

Revision history for this message
Jergen Dutch (jergendutch) wrote :

> Jergen, I think you're missing the point here - /etc/debian_version is mostly for use by tools
> and lets them know that they're running on something that looks roughly like Debian.

But it's not. The presence of the file shows the the machine is Debian, the content of the file says which specific version of Debian.

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

For what it is worth, the standard way to find out what distribution you are on is to execute "lsb_release":

first standardized in 2001:

http://refspecs.freestandards.org/LSB_1.0.0/gLSB/lsbrelease.html

current standard:

http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/lsbrelease.html

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

I have learned that some Linux distributions don't offer the lsb_release executable (in their default set of packages) but *do* have an /etc/lsb-release file. Therefore, writers of tools are advised to try parsing the /etc/lsb-release file, even though the format of that file is not part of the LSB standard. You could also try executing lsb_release (which is part of the LSB standard) first and then fall back to parsing the file or vice versa.

Amber (ambersduo)
Changed in base-files (Ubuntu):
status: Confirmed → Incomplete
status: Incomplete → Confirmed
status: Confirmed → Fix Committed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Amber-

Why mark this Fix-Committed?

Where is the fix?

Changed in base-files (Ubuntu):
status: Fix Committed → Incomplete
status: Incomplete → Confirmed
Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for posting this bug.

Does this occur in Lucid?

Changed in base-files (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Chris Hofstaedtler (zeha) wrote :

/etc/debian_version is still in Lucid and Maverick, and it's contents is still open to debate. You could've looked this up yourself.

Changed in base-files (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jo-Erlend Schinstad (joerlend.schinstad-deactivatedaccount) wrote :

Bug triage is a time consuming and often quite boring job which should be appreciated. It makes sense to ask the subscribers of a bug if they're still bothered by it, I think. Because that's the whole point of triage: the ones who are able to fix the bugs, should spend time fixing them, not on triage. This bug has been around for more than five years, and there has been no activity for more than six months. I think we can live with a few potentially unnecessary messages in order to get a better understanding of which bugs are still valid. Because some bugs go away as a result of another bug getting fixed.

Revision history for this message
Mark Brown (broonie) wrote :

While triage is useful work this sort of automated posting to bugs asking for information which can be trivially obtained really doesn't help the reputation of Ubuntu's bug handling - there's clearly nobody actually looking at the bug, and making users do busy work to deal with the bots is just wasting their time.

This is especially true since there never seems to be any acknowledgement from the bots generating these messages in Ubuntu that there is a bot involved. Some other projects do similar things by posting a note saying something along the lines of "We're sorry, we've got far too many bugs to handle and this seems old so we're running this script" which goes over a lot better.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Christian Hofstädtler and Mark Brown, thank you for your contributions to this bug. I read all bugs I comment on and do not use a bot. I did not know how to check it, now I do ;) Despite this, while your opinions on the triviality of bug reproduction and Mark's opinion on bug post comment syntax is duly noted, to maintain a respectful atmosphere, please follow the code of conduct - http://www.ubuntu.com/community/conduct/. Bug reports are handled by humans, the majority of whom are volunteers (including myself), so please bear this in mind.

tags: added: yakkety
tags: added: zesty
tags: added: artful
tags: added: bionic
tags: added: cosmic
tags: added: disco
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.