SPARC T4, Solaris 11, no access to internet, how to install system headers (or a working compiler)

compilationsolarissparc

I need to compile a C program on SPARC T4-1 (Solaris 11) machine that has been deployed to customer network, and it no longer has access to the Internet.
Originally during the setup, compilation tools, nor the system headers were installed, and now I'm having trouble compiling a C program.

I have installed a local repository, as per instructions around the Internet, and pkg pubisher now shows:

# pkg publisher
PUBLISHER                             TYPE     STATUS   URI
solaris                               origin   online   file:///export/repoSolaris11/repo/

However, if I try installing gcc (package gcc-dev, I think?), I a bunch of complaints from the package manager (This version is excluded by installed incorporation), I have come to conclusion that it's because originally it was a factory install (the machine came setup from the Oracle, and it was not touched), and now I have tried adding a local repository, and the versions mismatch. Complete install attempt: http://pastebin.com/m3wazmU7

I thought of another way to install a C compiler would be the Solaris Studio IDE (on a DVD), and I have cc now on the machine, but it's missing the system headers, so I cannot compile even a simple hello world. Attempting to install system/headers results into very similar as with gcc-dev:

sudo pkg install system/header
Creating Plan /                
pkg install: No matching version of system/header can be installed:
  Reject:  pkg://solaris/system/header@0.5.11,5.11-0.175.1.0.0.24.2:20120919T184855Z
  Reason:  This version is excluded by installed incorporation     
  pkg://solaris/consolidation/osnet/osnet-incorporation@0.5.11,5.11-0.175.0.9.0.5.1:20120705T180850Z

I'm not at all familiar with how solaris package management works, and I wonder if there is some way I could get rid of these incorporation messages ? Or could I just unzip the proper header files from somewhere, and compile the program against those headers ?

Thanks for any tips

Best Answer

I can't disagree with Danila -- if you have a support contract, use it. In fact, you'll probably want to use it to upgrade from Solaris 11 to Solaris 11.1.

That said, your problem is that the local repository you've attached is newer than your installed system, and doesn't have the matched set of packages. You want to get the Solaris 11 repository ISO (and all SRUs), and not the Solaris 11.1 repo ISO.

This is the key part of the error message:

  Reason:  All versions matching 'require' dependency pkg:/group/feature/developer-gnu@0.5.11,5.11-0.174.0.0.0.0.0 are rejected
    Reject:  pkg://solaris/group/feature/developer-gnu@0.5.11,5.11-0.175.1.0.0.24.0:20120904T180329Z
    Reason:  This version is excluded by installed incorporation pkg://solaris/consolidation/ips/ips-incorporation@0.5.11,5.11-0.175.0.9.0.3.0:20120623T000446Z

That's saying that no version of the package "developer-gnu" (the new name for "gcc-dev") can be installed. It only found one (the S11.1 version -- "0.5.11" is the version for all Solaris 11 system packages, and the branch version after the dash says "Solaris 11" (0.175) "Update 1" (.1), no SRU (.0), no special platform (.0), build 24 (.24), no respins (.0)), but it can't because the ips-incorporation package, which is the S11 (FCS) SRU 9 version is installed, and that will restrict developer-gnu to the matching version. You can see that precisely if you run

pkg contents -m ips-incorporation

and look for the depend action (of type=incorporate) on fmri=group/feature/developer-gnu@...

The advice for relaxing constraints by setting facets is useful for some packages, but not, as it turns out, this one. Additionally, developer-gnu is just a group package that will pull in a bunch of GNU development utilities on top of gcc itself, including GNU binutils, GNU make, the autotools, gdb, etc. In a better world, you'd be able to set the version-lock facets for each of those packages to false and just install them independently, ignoring the group package. But you'd still run into the problem that the versions of those packages in the repo you have were built against a version of the OS that's newer than what you have installed, and so their dependencies are against those newer versions as well. Your only options, other than skirting the packaging system, are to upgrade, or get the S11+SRU repositories.