I want to create a deb string for my APT repository. Now it looks like deb http://sitename $(lsb_release -cs) main

Ubuntu derivatives display their own distribution name in lsb_release -cs (like sarah on Mint). Is there a universal way to get upstream Ubuntu version on Ubuntu itself and its derivatives?

closed as off-topic by karel, edwinksl, Anwar, chaskes, Pilot6 Aug 27 '16 at 9:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – karel, edwinksl, Anwar, chaskes, Pilot6
If this question can be reworded to fit the rules in the help center, please edit the question.

  • cat /etc/version or cat /proc/version might get you what you want. – Android Dev Aug 26 '16 at 23:05
  • 1
    I need an Ubuntu distribution codename, not kernel version string. – Alexander Shishenko Aug 26 '16 at 23:08
  • 1
    Oh. Well in any case, I suggest you edit the title. Your question already has 2 close votes for being off topic. – Android Dev Aug 26 '16 at 23:09

Ubuntu doesn't define any standard way to do this. A derivative may or may not include the name of its upstream release somewhere in a file.

The best way is probably to use some package versions to guess the upstream version. The package libc6 would be a good candidate for that, coreutils may be another one.

Not the answer you're looking for? Browse other questions tagged or ask your own question.