11

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

1
  • 1
    try uname -a. Commented Jan 12, 2012 at 0:25

3 Answers 3

13

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 
2
  • 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? Commented Jan 6, 2014 at 9:04
  • For just distribution checking lsb_release -i works quite well, but that include "ensure that lsb_release is installed" in the instructions... This user seem to have asked about the kernel and Gentoo version, rather than identifying the distribution. (Although "distro version #" isn't the clearest phrashing) Commented Feb 4, 2015 at 15:07
7

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...

2
  • 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? Commented Jan 13, 2012 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) Commented Jan 17, 2012 at 10:42
5

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.

2
  • Please don't post just links as answers. As soon as that blog disappears/changes CMS engine/URL schemes, your answer will become useless. Commented Jan 12, 2012 at 11:49
  • 2
    That's a good point. I edited my post to include the solution referred in the blog. Commented Jan 12, 2012 at 14:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.