[RESOLVE] Find the name of Ubuntu version with Mint

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

[RESOLVE] Find the name of Ubuntu version with Mint

Postby percherie on Wed Mar 06, 2013 3:18 pm

Hi,


I use Mint and I want a solution for the name Ubuntu version that matches my version Mint

Nadia For example, I want to get Quantal. It is for use in the command line. Currently the following commands can not function because of the use of $lsb_release -sc

For exemple :
Code: Select all
echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` contrib"

OR
Code: Select all
wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list

OR
Code: Select all
echo "deb http://josm.openstreetmap.de/apt `lsb_release -sc` universe #JOSM" | sudo tee -a /etc/apt/sources.list && wget -q http://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add - && sudo apt-get update
Last edited by percherie on Wed Mar 06, 2013 5:55 pm, edited 1 time in total.
percherie
Level 1
Level 1
 
Posts: 3
Joined: Wed Mar 06, 2013 3:10 pm

Linux Mint is funded by ads and donations.
 

Re: Find the name of Ubuntu version with Mint

Postby karlchen on Wed Mar 06, 2013 5:46 pm

Hello, percherie.

On an absolutely up-to-date Mint13 here, there is a file named /etc/os-release. It has been introduced by some Ubuntu update which turned the underlying Ubuntu into 12.04.2. The content of the file /etc/os-release reads
Code: Select all
NAME="Ubuntu"
VERSION="12.04.2 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.2 LTS)"
VERSION_ID="12.04"

Code: Select all
lsb_release -sc
returns the string maya.
So in order to get the string precise which is the codename of the Ubuntu version which Maya has been built upon, I can use the following command:
Code: Select all
grep "PRETTY_NAME" /etc/os-release | awk '{ print $2 }'
It returns the string precise here.
Provided the same file /etc/os-release exists on Nadia as well, the command should return quantal in your case.
I cannot check right now because I am on Mint 13. But I will definitely check next time I boot up Nadia.

HTH,
Karl
Enlightened by Lucid Lynx, enchanted by Maya Mint, productive on Precise Pangolin's Minty sister
User avatar
karlchen
Level 5
Level 5
 
Posts: 938
Joined: Sat Dec 31, 2011 7:21 am

Re: Find the name of Ubuntu version with Mint

Postby percherie on Wed Mar 06, 2013 5:55 pm

Thank you

My english it's light but i am all understand ;-)
percherie
Level 1
Level 1
 
Posts: 3
Joined: Wed Mar 06, 2013 3:10 pm

Re: [RESOLVE] Find the name of Ubuntu version with Mint

Postby karlchen on Thu Mar 07, 2013 6:14 pm

Hello, percherie.

As promised, here is the result of the test done on my Mint 14 system:
Code: Select all
$  lsb_release -sc
nadia
$ grep "PRETTY_NAME" /etc/os-release | awk '{ print $2 }'
quantal
$

So the command works provided the file /etc/os-release is up-to-date.

Cheers,
Karl
Enlightened by Lucid Lynx, enchanted by Maya Mint, productive on Precise Pangolin's Minty sister
User avatar
karlchen
Level 5
Level 5
 
Posts: 938
Joined: Sat Dec 31, 2011 7:21 am

Re: [RESOLVE] Find the name of Ubuntu version with Mint

Postby percherie on Thu Mar 07, 2013 6:57 pm

Thank you karl for your test (and new install of mint)
percherie
Level 1
Level 1
 
Posts: 3
Joined: Wed Mar 06, 2013 3:10 pm


Return to Other topics

Who is online

Users browsing this forum: No registered users and 4 guests