LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-02-2009, 03:11 PM   #1
Scormen
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Rep: Reputation: 0
How to show what distribution is installed?


Hi all,

It isn't a real software, but a shell scripting question.

I'm looking how it is possible to show what Linux distribution is installed. This should be done in a shell script.

I found "cat /etc/*release". But, does this work in all the major Linux distributions? And, how can I get that result in "one word"?

Thanks,
Kris
 
Old 04-02-2009, 04:13 PM   #2
rizwanrafique
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
Check /etc/issue as well.
 
Old 04-02-2009, 04:16 PM   #3
Scormen
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for your answer, rizwanrafique.

But, how can I test with a shell script what distribution it is?

Grtz,
Kris
 
Old 04-02-2009, 04:29 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
This might help:
http://linuxmafia.com/faq/Admin/release-files.html

Of course, you should note that there are several thousand known distributions of Linux, and more appearing all the time, so if you're trying to do something that behaves differently on different distributions then you may have your work cut out for you
 
Old 04-03-2009, 02:27 AM   #5
Scormen
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for that list!
I just need the "major" distro's, so it isn't that much work.

Grtz,
Kris
 
Old 04-03-2009, 07:41 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Something else that may be of use if the distro si lsb compliant..

Code:
user@it-lenny:~$ lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 5.0 (lenny)
Release:	5.0
Codename:	lenny
man lsb_release for command line options
 
Old 04-03-2009, 07:45 AM   #7
Scormen
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Indeed, but that is not working for all distro's. Look eg at Fedora.
 
Old 04-03-2009, 09:03 AM   #8
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Quote:
Originally Posted by Scormen View Post
Indeed, but that is not working for all distro's. Look eg at Fedora.
For FEDORA core 8 it works, so I think that for more recent version it will work too...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What System Distribution is installed pnicos Linux - Newbie 6 06-18-2007 10:29 PM
Apt Show Installed Packages moo-cow Linux - General 1 07-06-2006 02:48 PM
RealPlayer 10 installed-doesn't open or show up keithk2 Linux - Software 1 09-29-2005 01:07 AM
Installed software doesn't allows show up on my system njschroe SUSE / openSUSE 1 02-02-2005 02:29 PM
How to get KDE to only show installed programs vdogvictor Linux - Software 2 06-01-2004 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration