Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct way to identify which version of SunOS is currently running?

share|improve this question
up vote 4 down vote accepted

Use following command uname -r in terminal

share|improve this answer
That will probably tell you what you want. In sun lingo, "-r" is the "release level" and "uname -v" is the version. "uname -a" will almost certainly tell you what you need to know. – quadruplebucky Mar 1 '10 at 13:01
Using uname is very imprecise on Solaris. You almost might as well just use uname -s. See my answer for the correct way to do this. – bahamat Aug 14 '11 at 21:22

To clear things up for everyone:

  • uname -r will show the major version number prefixed by 5. (e.g., Solaris 9 will be 5.9, 10 will be 5.10 and 11 will be 5.11)
  • uname -v will be the kernel patch number or nevada build number. Prior to OpenSolaris this will be meaningless to you as patches can be installed independent of update releases. On Solaris 10 & earlier it's a patch number (on S10 x86 it's "Generic_142910-17", or thereabouts). Any Nevada build (OpenSolaris, Solaris 11 and IllumOS based releases) will be the build number. On Solaris 11 Express it's "snv_151a"
  • The contents of /etc/release will be have the actual product version. E.g., Solaris 10 update 9 will show "Solaris 10 9/10 s10x_u9". Again, Nevada builds will have the snv build number.

In any case the best way to get the correct meaningful version number is the contents of /etc/release. Specifically, the second to the last field of the first line.

Or most simply:

$ head -1 /etc/release | awk ' { print $(NF-1) }'


A note about major/minor version confusion on Solaris.

Solaris started life as SunOS, which was based on BSD, which ended with the kernel at version 4 (same as the BSD 4.x line). Time passes and it's re-based on System V. The product is renamed Solaris, and branded as Solaris 2. The kernel version is set to 5.0. Solaris 2 through 2.6 are released, corresponding with kernel versions 5.0-5.6. With the next release the "major" numbers are completely removed from marketing and branding and it's simply called as Solaris 7. This tradition continues to today. So Solaris 10 is actually Solaris 2.10, kernel version 5.10. Solaris 11 is likewise 2.11 and 5.11.

But for all intents and purposes the traditional "minor" number is now the "major" number. There will never be SunOS 6.0, nor Solaris "3", which is why I refer to it as the major number.

share|improve this answer
« uname -r will show the major version number prefixed by 5» — As far as SunOS (i.e. not Solaris) is concerned, 5 is the major version, 9, 10, and 11 are minor versions. – jlliagre Aug 15 '11 at 3:38
« uname -v will be the repository version number» — With Solaris 10 and older, you'll get the kernel patch number here which isn't that meaningless. With newer versions, that's the build number as patching is no more implemented. – jlliagre Aug 15 '11 at 3:43
@jlliagre I'll update my answer for further explanation. – bahamat Aug 15 '11 at 3:58
It is not "svn_151a" but "snv_151a" as "151a" is a Solaris Nevada build number, not a subversion number. SunOS started as SunOS 1, not SunOS 4. Latest SunOS 4 was based on BSD 4.3, not 4.4. You shouldn't say "Solaris 10 is actually Solaris 2.10" as there is no "Solaris 2.10" in the first place. You shouldn't write "There will be no SunOS 6.0" even while it's unlikely to happen. – jlliagre Aug 15 '11 at 5:02
/etc/release is indeed the right place to look for the installed Solaris version, which is what most people are interested with. I'm not commenting about "intentionally abstracted away details" but about inaccurate or definitive statements. For example, you are still claiming the kernel patch release number is meaningless while most Solaris admins and support people will care a lot. Only the owner of the SunOS brand can decide if a 6.0 version will show up or not. Solaris development uses mercurial since 2008, subversion was never used to manage its source tree. – jlliagre Aug 15 '11 at 6:03

You can also try:

cat /etc/release
share|improve this answer

Your Answer


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.