I'm having a peculiar problem, where a server has already been deployed, and it's no longer connected to the network. For it's original purpose, it didn't need any C/C++ compiling tools, and thus they were never installed.

I have checked /usr/sfw/bin, but indeed they are missing from there..

I'm not really familiar with Solaris environment, but I can't seem to find GCC as "installable package" (similar as for example dpkg for debian) for Solaris 11. There seems to be stuff for older Solaris environments though. Is there some way to post-install these tools without using the internet connection and package manager? Is there, for example, a DVD image somewhere that I could use as a source for package manager?

I would like to run a program that I wrote in C++, but I can't compile the code on the my machine as I'm running 64-bit x86 Linux machine.

I have access to older Solaris 8 machine, that is setup OK, and I that I used to create a static binary (used gcc 3.8). The program runs, but there is some strange behavior with string formatting, and it doesn't execute as expected - this behavior is not seen on the Solaris 8 host.

I can copy the libraries from the machine, for example to create a cross compiling environment, but I'm not sure if it's that easy. From dynamically linked file, I see for example that I link against libstdc++, but that's missing from the target machine.

So I wonder if I can create proper cross compiling environment?


/usr/sfw/bin is the bundled gcc path with Solaris 10. On Solaris 11.1, gcc is, when installed, directly available in /usr/bin as a symlink that points to /usr/gcc/<version>/bin/gcc.

There is now an on disk data format for ips packages (.p5p files) but I would suggest to download the whole repository (look for Oracle Solaris 11.1 repository image in the Solaris 11.1 download page) and create your own ips service. See this blog for details. That would allow to install whatever package gcc is dependent on and possibly other packages you might be still missing for your task.

  • This seems to be exactly what is needed. Thanks for the answer, I'm downloading now, and the instructions seem fairly straight forward how to set this up. I seem to have been googling with wrong words... – julumme Sep 3 '13 at 2:00

To me it seems you can access the Solaris 11 Package Repository on Web, too, and you can download packages there. Edit: I stand corrected (thanks @alanc), you can only download "headers" for the packages there, so the only option is to obtain the packages otherwise.

I assume there is a way to direct the Solaris package manager to install a single file with some command line parameter(s). The problem with this approach is finding out all the dependencies that might still be missing without iteratively downloading, trying to install and searching again for the next one.

I'd also assume there are DVD images that contain the original release versions of all the essential packages, and gcc is something I'd expect to be part of that.

  • Thanks for the suggestion. I found this as well, but it seemed to just launch the package manager, to install that package - I couldn't find a way to download the package offline – julumme Sep 3 '13 at 1:59
  • As always with web pages and browser, there tends to be a way to force saving the link contents. I don't have Solaris and so to my browser the p5i file type means nothing and so it offers to save it directly. You might need to use browser context menu on the link and select something like Save link contents as a file. The ultimate way is to use e.g. wget <package_url> on command line (again, I don't know if Solaris has wget but probably there is some similar tool anyway). – zagrimsan Sep 3 '13 at 5:24
  • 2
    You can't download installable packages via the web ui, just files containing minimal metadata to tell the package manager to connect to the repository to download the packages. To get installable packages from the repository you need to use the pkgrecv command to grab them, but then as noted you'll have to find all the dependencies yourself and get them too. The full repository image jlliagre suggested is far less work to download. – alanc Sep 3 '13 at 16:45

Be aware that if you are inside a local zone (are you?) then you don't actually need access to Internet in order to use the pkg commands, or more correctly that zone doesn't need it. The reason is that IPS (when used inside zones) automatically makes use of the global zone's IPS as a proxy repo server. But of course if even the global zone doesn't have Internet access then you'll need to follow jlliagre's answer.

You can look at this posting for what to actually install on Solaris 11. It will be a couple of pkg commands and you're done!


One option is to obtain the packages you need from www.UNIXPackages.com (requires a subscription) and the individual files can be downloaded to one machine (Linux in your case), burned to a DVD and then moved and installed on a Solaris 11 machine.

No internet connection to the Solaris 11 machine is needed. Updates and other additions would then be easy to do in the future.

This is one of the advantages UNIX Packages has over IPS and OpenCSW. Feel free to send technical questions support at unixpackages dot com.


I had a similar issue and used another system that was connected to the internet & support repo. Quick summary of steps follows. However, note that you may run into dependency and versioning issues, so the reco'd/preferred approach would be to build a full local repo server -- especially if your system(s) are expected to stay disconnected to the support repo.

// Get the iperf pkg and save as /tmp/iperf.p5p

pkgrecv -s https://pkg.oracle.com/solaris/support/ -d /tmp/iperf.p5p -a -r pkg://benchmark/iperf

// Check the contents of the package with:

pkgrepo -s /tmp/iperf.p5p list

// or you can use:

pkg list -f -g /tmp/iperf.p5p

// I had to disable the solaris publisher to install pkg set-publisher --disable solaris

// Sneaker-net the p5p file to the disconnected system

// Install pkg(s):

pkg install -g file:///tmp/iperf.p5p benchmark/iperf

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.