2

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/[email protected],5.11-0.175.1.0.0.24.2:20120919T184855Z
  Reason:  This version is excluded by installed incorporation     
  pkg://solaris/consolidation/osnet/[email protected],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

2

3 Answers 3

10

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/[email protected],5.11-0.174.0.0.0.0.0 are rejected
    Reject:  pkg://solaris/group/feature/[email protected],5.11-0.175.1.0.0.24.0:20120904T180329Z
    Reason:  This version is excluded by installed incorporation pkg://solaris/consolidation/ips/[email protected],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.

2
  • Great answer + always it is better to run "sudo pkg info -r system/header" to see what is what and "pkg info entire". Dec 11, 2013 at 19:05
  • Very clarifying answer, thank you. Once again I will ask about official support from the customer, but at least now I understand what was the problem here.
    – julumme
    Dec 12, 2013 at 2:21
4

If this is production SPARC T4 box with Solaris 11 on it. If i was in your situation, I would not mess with it and get a hold of Oracle support. Especially in the case of the doubt while installing one of the crucial systems aspects as system headers for "gcc" while being in the state of "I'm not at all familiar with how solaris package management works." Please do that and you will save lots of time for yourself and for other people.

1
  • You are of course 100% correct with the advice. Though sometimes it's just not in the the reality in the server room :/
    – julumme
    Dec 11, 2013 at 4:17
2

Well, first of all go read Danila's answer.
If you have no familiarity with Solaris package management, don't muck around with it on a production system - do like he said and get someone who knows what they're doing to help you.


With that out of the way:

Your first option is to tell Solaris not to be such a picky beast about the version restrictions in incorporations.
(For more detail on incorporations, check out this blog post.)

Your other option is to download and install third-party compiler packages from another source like sunfreeware.com. As you say you have no internet access you'll have to get them onto CD/DVD/USB stick/Some other media you can connect to your system.
Generally the sort of system with no internet access has other security constraints, and the people responsible would frown on installing unaudited third party packages.

Which brings us to option 3: Install a compiler on some other system, build your software there, package it, and install it on this machine.
Depending on the reason you don't have a compiler this may be the best option...

2
  • While Danila is of course correct, sometimes there are no choices :/ We have older sparc machine here, but the solaris version is older, and even statically compiled binary seems to act differently on the solaris 11 than on x86. I'm using couple standard template classes, and I'm suspecting some problem is coming from there.. So there is no way to get headers from somewhere for solaris (for example in linux you would go to kernel.org and just download them)? solarisfreeware.com seems to have become a commercial operation at unixpackages.com
    – julumme
    Dec 11, 2013 at 4:12
  • Unless you know what you are doing, it is highly advisable that you DO NOT release the restrictions. Jun 9, 2017 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .