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

  • 1
    try uname -a. – Kevin Jan 12 '12 at 0:25

Basic commands will be the following:

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

# uname -r

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
| 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 '14 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) – Gert van den Berg Feb 4 '15 at 15:07

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

| 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

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

cat /etc/issue


cat /etc/*-release


lsb_release -a

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

| 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
  • 2
    That's a good point. I edited my post to include the solution referred in the blog. – neuron34 Jan 12 '12 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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