Ubuntu: Using Ubuntu derivatives *and* Ubuntu, how do I get the Ubuntu codename?


I need the Ubuntu codename for generating an apt source.

On Ubuntu, I can use lsb_release --codename --short, which will return (e.g.) trusty.

On (e.g.) Linux Mint, if I use lsb_release -cs, it returns (e.g.) rosa. If I want the upstream codename, I can use lsb_release -csu (which returns trusty).

However, if I use lsb_release -csu on Ubuntu, I get an error lsb_release: error: no such option: -u.

Is there a way to get the upstream-iest Ubuntu codename, including on Ubuntu?


You could try running lsb_release -csu, checking if it gave output or returned an error (hiding the error message), and fall back to lsb_release -cs in that case:

lsb_release -csu 2> /dev/null || lsb_release -cs  


Ubuntu's "upstream" is Debian and so

$ cat /etc/debian_version  stretch/sid  $   

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »