Showing posts with label pkg. Show all posts
Showing posts with label pkg. Show all posts

Saturday, August 31, 2019

Packaging: OpenSolaris, Solaris 11 & Illumos

Packaging: OpenSolaris, Solaris 11 & Illumos

Packaging under UNIX Systems had traditionally been the SRV4 type of packaging. Under newer Operating Systems, network enabling the packaging had been accomplished, through proprietary extensions. Open Source Communities, like OpenCSW, had created network enablement for SVR4 packages. Illumos had done a similar move, from the OpenSolaris base. This tool is called "pkg".

What is "pkg"

The "pkg" tool is called the Image Packaging Systems. Today, packaging under the direction of Oracle had moved to Python language based packaging, instead of native C based binaries, placing greater levels of external language dependencies on the base OS. SVR4 packaging uses multiple binaries (i.e. pkgadd, pkgrm, pkgproto, etc.), while "pkg" bundles many aspects of packaging into a single executable.

Cheat Sheet & Exercises

A short Image Packaging System cheat-sheet is available from Oracle on the , using "wireshark" as an example. The cheat-sheet can be used for developing other exercises to download & manage other tools like: fping & top

Friday, November 27, 2015

Solaris 11: The pkg Repositories

[Solaris Logo, courtesy former Sun Microsystems]

Abstract:

Packaging has long been the basis of modern Operating Systems, dating back to AT&T System V. Solaris adopted SVR4 packaging, when Sun Microsystems started growing from an Operating System needing a compiler to a production Operating System to be deployed. SVR4 Packaging was originally based upon the concept of a Stream (recorded upon Sequential Block infrastructures likes Tape) or a Tree (recorded Random Block infrastructures like Disk.) Sun Microsystems was astutely aware that "http" protocol was not much different from a "tape", where a stream of data was pulled down, and they upgraded SVR4 to support HTTP repositories with encryption and license keys. Somewhere along the way, Sun lost their way, and created a proprietary packaging system with fewer capabilities, called IPS, based upon the new command "pkg"... but Oracle is making the best of it.

[former OpenSolaris logo]

The "pkg" Repository

The concept of a Package Repository with the Image Packaging System was introduced with OpenSolaris. The repository would be served up through a web server and secured with certificates.




[Oracle Logo, courtesy Oracle Corporation]

Oracle pkg Repositories

There are two kinds of Oracle “pkg” repositories:
1.       Non-production Release Repository
Designated as: http://pkg.oracle.com/solaris/release/
2.       Production Support Repository
Designated as: https://pkg.oracle.com/solaris/support/


The document describing the Solaris 11.2 Package Publisher info:
http://docs.oracle.com/cd/E36784_01/html/E36802/gijmo.html

Checking Repository

The newly installed OS is using the Oracle Package Publisher defaults to the Release Repository.
sun9876/root# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION                           
solaris                     origin   online F http://pkg.oracle.com/solaris/release/

Additional detail can be reviewed about Oracle’s “solaris” release publisher:
sun9876/root# pkg publisher solaris

            Publisher: solaris
                Alias:
           Origin URI: http://pkg.oracle.com/solaris/release/
              SSL Key: None
             SSL Cert: None
          Client UUID: 6367a630-fbe6-11e3-8701-5bf522237f54
      Catalog Updated: August 18, 2015 04:44:20 PM
              Enabled: Yes

To check the current OS Release and Update – note: installed is Solaris 11.2 (0.175 is Solaris 11) SRU 0

sun9876/root# pkg info entire
          Name: entire
       Summary: Incorporation to lock all system packages to the same build
   Description: This package constrains system package versions to the same
                build.  WARNING: Proper system update and correct package
                selection depend on the presence of this incorporation.
                Removing this package will result in an unsupported system.
      Category: Meta Packages/Incorporations
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.2.0.0.42.0
Packaging Date: June 24, 2014 07:38:32 PM
          Size: 5.46 kB
          FMRI: pkg://solaris/entire@0.5.11,5.11-0.175.2.0.0.42.0:20140624T193832ZZ


To check the Oracle Release Repository – note: available is Solaris 11.2 (0.175 is Solaris 11) SRU 1
sun9876/root# pkg info -r entire
          Name: entire
       Summary: Incorporation to lock all system packages to the same build
   Description: This package constrains system package versions to the same
                build.  WARNING: Proper system update and correct package
                selection depend on the presence of this incorporation.
                Removing this package will result in an unsupported system.
      Category: Meta Packages/Incorporations
         State: Not installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.2.1.0.2.1
Packaging Date: September 23, 2014 10:49:40 PM
          Size: 5.46 kB
          FMRI: pkg://solaris/entire@0.5.11,5.11-0.175.2.1.0.2.1:20140923T224940Z

There are 148 updates available from the Oracle Release repository.
sun9876/root# pkg list -u | wc -l
     148

To list the updates available:
sun9876/root# pkg list -u | head
NAME (PUBLISHER)                                  VERSION                    IFO
archiver/gnu-tar                                  1.27.1-0.175.2.0.0.42.1    i--
compress/bzip2                                    1.0.6-0.175.2.0.0.42.1     i--
compress/gzip                                     1.5-0.175.2.0.0.42.1       i--
compress/p7zip                                    9.20.1-0.175.2.0.0.42.1    i--
compress/pbzip2                                   1.1.6-0.175.2.0.0.42.1     i--
compress/pixz                                     1.0-0.175.2.0.0.42.1       i--
compress/unzip                                    6.0-0.175.2.0.0.42.1       i--
compress/xz                                       5.0.1-0.175.2.0.0.42.1     i--
compress/zip                                      3.0-0.175.2.0.0.42.1       i—

A dry-run of the update shows 8 packages updates available with release, and size - no reboot required.
sun9876/root# pkg update -nv
            Packages to update:         8
     Estimated space available: 275.69 GB
Estimated space to be consumed:  65.63 MB
       Create boot environment:        No
Create backup boot environment:       Yes
          Rebuild boot archive:        No

Changed packages:
solaris
  consolidation/sunpro/sunpro-incorporation
    0.5.11,5.11-0.175.2.0.0.37.0:20140414T130238Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200719Z
  consolidation/userland/userland-incorporation
    0.5.11,5.11-0.175.2.0.0.42.1:20140623T010405Z -> 0.5.11,5.11-0.175.2.1.0.2.0:20140723T184045Z
  developer/assembler
    0.5.11,5.11-0.175.2.0.0.37.0:20140414T130241Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200720Z
  entire
    0.5.11,5.11-0.175.2.0.0.42.0:20140624T193832Z -> 0.5.11,5.11-0.175.2.1.0.2.1:20140923T224940Z
  system/library/c++-runtime
    0.5.11,5.11-0.175.2.0.0.37.0:20140414T130401Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200722Z
  system/library/math
    0.5.11,5.11-0.175.2.0.0.37.0:20140414T130409Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200728Z
  system/library/mmheap
    0.5.11,5.11-0.175.2.0.0.23.0:20130916T153150Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200732Z
  system/library/openmp
    0.5.11,5.11-0.175.2.0.0.37.0:20140414T130412Z -> 0.5.11,5.11-0.175.2.1.0.4.0:20140728T200733Z

To update from 11.2.0 to 11.2.1 (which was the latest at the time of this article publishing):
sun9876/root# pkg update

Management through Ops Center

If the operating system instance is managed through Ops Center, the publisher repositories are changed, and patching can be done centrally.

Ops Center server is the local proxy, holding patches & packages from Oracle
sun5582/dh127087$ pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION                           
solaris                     origin   online F https://oracle-oem-oc-mgmt-sun9999:8002/IPS/
cacao                       origin   online F https://oracle-oem-oc-mgmt-sun9999:8002/IPS/
mp-re          (non-sticky) origin   online F https://oracle-oem-oc-mgmt-sun9999:8002/IPS/
opscenter                   origin   online F https://oracle-oem-oc-mgmt-sun9999:8002/IPS/

The operating systems managed through Ops Center can be patched remotely or can be patched through the command line, using Ops Center server as the supported package repository.

Conclusions

While the detour that Sun Microsystems took, taking packaging back a couple decades, Oracle started to make the best of it. With the release of Ops Center, to manage the Solaris cloud components to automatically configure the pkg components and provide a continuous feed of packages for their Operating System and Firmware, Oracle has been making some sweet lemonade from their lemons.

Wednesday, November 16, 2011

Enabling VNC in Solaris Express 11


Enabling VNC Under Solaris 11 Express

Abstract:
Open Systems have traditionally been accessed via Command Line. MIT create a fully object oriented, multi-tiered, open source windowing system called X Windows, which was quickly adopted by nearly all computing industry players. While X Windows is well suited for local area network technology, the need for wide area network technology was addressed through several different attempts, such as X11R6 "Broadway" and proxies leveraging compression. A lighter WAN suitable screen display protocol, referred to as Virtual Network Computing (VNC) is also commonly used for X displays.

Procedure:
Solaris 10 was shipped with VNC, instructions for enabling VNC under Solaris are found here.

Solaris 11 Express was shipped with a basic VNC service mostly available. The procedure to fully enable VNC under Solaris 11 is as follows:
  • Load Gnome Desktop Manager
# pkg install slim_install
  • After the ~400mb package is installed note the following issue:
# svcs consolekit
STATE STIME FMRI maintenance 1999 svc:/system/consolekit:default
The GDM depends on the console-kit-daemon for "defining and tracking users"
(console-kit-daemon man page). A generic error will occur telling you that a consolekit dependency is restarting too quickly.
  • Check the consolekit dependencies for restarting:
# svcs -d consolekit
onl
ine 1999 svc:/system/dbus:default
online 1999 svc:/system/filesystem/local:default
The -r is to recursively enable the daemon and then dependencies in the correct order.
#svcadm disable dbus
#svcadm clear consolekit

#svcadm enable -r consolekit
# vi /etc/gdm/custom.conf
[xdmcp] Enable=true
wq
  • A restart of the Gnome Display Manager and enabling of Xvnc are the last steps.
# svcadm restart gdm
# svccfg -s x11-server setprop options/tcp_listen=true
# svcadm enable xvnc-inetd