-5

I'm good at installing package in linux envrionment but newbie to solaris OS. I'm in a bit urgent to install python - libxml2 package to my project. Does the below command will also work in solaris server for installation??

sudo apt-get install libxml2 libxml2-dev

I have tried googling, unfortunately not able to get. Can someone help me out?

4
  • 3
    --(urgent)-- really isn't our problem and we come with no SLA. Which version of Solaris, SPARC or x86?
    – user9517
    Jul 19, 2013 at 13:29
  • we are using x86
    – fewtalks
    Jul 19, 2013 at 13:36
  • and the version ?
    – user9517
    Jul 19, 2013 at 13:37
  • x86 with version 10
    – fewtalks
    Jul 19, 2013 at 13:41

3 Answers 3

1

The short answer: no, apt doesn't exist on Solaris.

The command to install packages in Solaris 10 is pkgadd. For this you'll need a package in the correct format. You might start by looking in sunfreeware.com. Once you've downloaded the package and gunzip/uncompressed it, you can do

pkgadd -d . SFWlibxml2       <-- replace with real package name

The Solaris 10 package management system only has a very rudimentary grasp of package dependencies, and might not prompt you to go and get other packages you need. The need for them will hopefully become obvious when you're a bit further down the line.

Of course the alternative is to build it from source, which may or may not be arduous depending on your level of skill.

1
  • Your short answer isn't quite correct: there is pkgutil, which is an apt-get workalike. It's not called 'apt' but it does the same job.
    – automaciej
    Apr 22, 2014 at 14:29
1

The Solaris equivalent of apt-get is pkgutil. It's an open source program (not from Oracle). It uses pkgadd under the hood, and its main functionality is automatic dependency resolution and package fetching.

The libxml package is provided by OpenCSW. Here's how to install it on Solaris 10:

pkgadd -d http://www.opencsw.org/pkg_get.pkg
/opt/csw/bin/pkgutil -U -y -i libxml2_dev libxml2_2

The -U flag will fetch the newest list of packages, the -y flag will make installation skip any y/n confirmations, and -i is equivalent to install in apt-get. The pkgutil utility will automatically fetch and install all dependencies.

After installation, the library will be in the /opt/csw/lib directory and the C/C++ header files will be in /opt/csw/include.

0

Another solution is to use Solaris 11 rather than Solaris 10.

In Solaris 11 you'll find that Python is there by default (actually you cannot even get rid of it because Solaris IPS feature depends on it).

Here is what you'll find by default on a Solaris 11.1 host:

Python 2.6.8 (unknown, Aug 30 2012, 01:56:38) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

BaseHTTPServer      cPickle             keyword             runpy
Bastion             cProfile            lib2to3             sched
CDIO                cStringIO           libbe               select
CGIHTTPServer       calendar            libbe_py            sets
ConfigParser        cgi                 libxml2             setuptools
Cookie              cgitb               libxml2mod          sgmllib
DLFCN               cherrypy            libxslt             sha
DocXMLRPCServer     chunk               libxsltmod          shelve
HTMLParser          cmath               linecache           shlex
IN                  cmd                 locale              shutil
M2Crypto            code                logging             signal
MimeWriter          codecs              lxml                simplejson
OpenSSL             codeop              macpath             site
Pyrex               collections         macurl2path         smtpd
Queue               colorsys            mailbox             smtplib
STROPTS             commands            mailcap             sndhdr
SUNAUDIODEV         compileall          mako                socket
SimpleHTTPServer    compiler            markupbase          solaris
SimpleXMLRPCServer  contextlib          marshal             solaris_install
SocketServer        cookielib           math                spwd
StringIO            copy                md5                 sqlite3
TYPES               copy_reg            mhlib               sre
UserDict            crypt               mimetools           sre_compile
UserList            csv                 mimetypes           sre_constants
UserString          ctypes              mimify              sre_parse
_LWPCookieJar       curl                mmap                ssl
_MozillaCookieJar   curses              modulefinder        stat
__builtin__         datetime            multifile           statvfs
__future__          dbhash              multiprocessing     string
_abcoll             dbm                 mutex               stringold
_ast                decimal             netrc               stringprep
_bisect             difflib             netsnmp             strop
_bytesio            dircache            new                 struct
_codecs             dis                 nis                 subprocess
_codecs_cn          distutils           nntplib             sunau
_codecs_hk          dl                  nss                 sunaudio
_codecs_iso2022     dlpi                ntpath              sunaudiodev
_codecs_jp          doctest             nturl2path          symbol
_codecs_kr          docutils            numbers             symtable
_codecs_tw          drv_libxml2         numpy               sys
_collections        dumbdbm             opcode              syslog
_csv                dummy_thread        operator            tabnanny
_ctypes             dummy_threading     optparse            tarfile
_curses             easy_install        os                  telnetlib
_curses_panel       email               os2emxpath          tempfile
_elementtree        encodings           osol_install        terminalui
_fileio             errno               parser              termios
_functools          exceptions          pdb                 textwrap
_hashlib            fcntl               pickle              this
_heapq              filecmp             pickletools         thread
_hotshot            fileinput           pipes               threading
_json               fnmatch             pkg                 time
_locale             formatter           pkg_resources       timeit
_lsprof             fpformat            pkgutil             toaiff
_multibytecodec     fractions           platform            token
_multiprocessing    ftplib              plistlib            tokenize
_random             functools           ply                 trace
_socket             future_builtins     popen2              traceback
_sqlite3            gc                  poplib              tty
_sre                gdbm                posix               types
_ssl                genericpath         posixfile           ucred
_strptime           getopt              posixpath           unicodedata
_struct             getpass             pprint              unittest
_symtable           gettext             privileges          urllib
_threading_local    glob                profile             urllib2
_warnings           grp                 pstats              urlparse
_weakref            gzip                pty                 user
abc                 hashlib             pwd                 uu
aifc                heapq               py_compile          uuid
anydbm              hmac                pybonjour           warnings
array               hotshot             pyclbr              wave
ast                 htmlentitydefs      pycurl              weakref
asynchat            htmllib             pydoc               webbrowser
asyncore            httplib             pydoc_topics        whichdb
atexit              idlelib             pyexpat             wsgiref
audiodev            ihooks              quopri              xcbgen
audioop             imageop             random              xdrlib
base64              imaplib             rbac                xml
bdb                 imghdr              re                  xmllib
beadm               imp                 readline            xmlrpclib
binascii            imputil             repr                xxsubtype
binhex              inspect             resource            zfs
bisect              io                  rexec               zipfile
bootadm-helper      itertools           rfc822              zipimport
bootmgmt            json                rlcompleter         zlib
bz2                 jsonrpclib          robotparser

Yes, libxml2 is there. No need to fiddle with anything.

You must log in to answer this question.

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