Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to tell from Bash what distro version # I'm running and also what Kernel version is included?

share|improve this question
1  
try uname -a. –  Kevin Jan 12 '12 at 0:25
add comment

3 Answers

up vote 8 down vote accepted

Basic commands will be the following:

# cat /etc/gentoo-release 
Gentoo Base System release 2.1

# uname -r
3.1.6-gentoo

Also you can obtain this information in a "gentoo-way" using app-portage/gentoolkit package utils:

# equery list baselayout
 * Searching for baselayout ...
[IP-] [  ] sys-apps/baselayout-2.1:0

# eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.1.4-gentoo
  [2]   linux-3.1.5-gentoo
  [3]   linux-3.1.6-gentoo *
  [4]   linux-3.1.7-gentoo
  [5]   linux-3.2.0-gentoo
  [6]   linux-3.2.0-gentoo-r1
share|improve this answer
    
Is uname -r really reliable for distribution checking? Will this not change if the user enters a custom string somewhere in the kernel or if he uses another kernel than the one provided with gentoo-sources? –  thomasa88 Jan 6 at 9:04
add comment

Gentoo is a rolling release, so although the information posted above is correct and relevant, there is another very important piece of the puzzle:

eselect profile list

It makes a lot more difference on the system than say the exact kernel release...

share|improve this answer
    
I take it you mean because the profile sets things like default USE flags? How does that impact what versions of software are running? And also by rolling release are you referring to the method by which portage updates the tree with overlays or something else? –  rutherford Jan 13 '12 at 0:14
2  
By "rolling release" I mean that gentoo is constantly updated and actual "releases" with pretty numbers aren't quite as important as with other distros. Yes, the USE flags are important, but profiles change more than just USE flags and will may also have an impact on which version of packages are installed (package masks etc) –  totaam Jan 17 '12 at 10:42
add comment

To check your Linux distribution name and version (not the kernel version):

cat /etc/issue

or

cat /etc/*-release

or

lsb_release -a

Source: http://www.dogruel.com/?p=36.

share|improve this answer
    
Please don't post just links as answers. As soon as that blog disappears/changes CMS engine/URL schemes, your answer will become useless. –  Mat Jan 12 '12 at 11:49
1  
That's a good point. I edited my post to include the solution referred in the blog. –  neuron34 Jan 12 '12 at 14:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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