X

News, tips, partners, and perspectives for the Oracle Solaris operating system

Trapped by Older Software

Peter Dennis
Senior Principal Software Engineer

Help! I am trapped by my Old Application Which Cannot Change. I need to update my Oracle Solaris 11 system to a later Update and/or Support Repository Update (SRU) but I find upon the update my favourite FOSS component has been removed.  My Old Application Which Cannot Change has a dependency upon it and so no longer starts. Help!

Oracle Solaris, by default, will ensure that the software installed on the system is up to date. This includes the removal (uninstall) of software that is obsolete. Packages can be marked as obsolete due to the owning community no longer supporting it,  being replaced by another package or later major version or for some other valid reason (we are very careful about the removal of software components).

However, by design, the contention problem of wanting to keep the operating system up to date but allowing for exceptions is addressed by Oracle Solaris's packaging system. This is performed via the 'version locks' within it.

Taking an example:

Oracle Solaris 11.3 SRU 20 obsoleted Python 2.6. This was because that version of python has been End of Lifed by the Python community. And so updating a system beyond that SRU will result in Python 2.6 being removed.

But what happens if you actually need to use Python 2.6 because of some application dependency ?

Well the first thing is check with the application vendor to see if there is a later version that supports the newer version Python, if so consider updating to that later version.

Maybe there is no later release of the application and so in this instance how do you get python-26 onto your system. Follow the steps below:

  • Identify the version of the required package: use pkg list -af <name of package> for example:

pkg list -af runtime/python-26

  • Identify if the package has dependencies that need to be installed:

pkg contents -r -t depend runtime/python-26@2.6.8-0.175.3.15.0.4.0

The python-26 package is interesting as it has a conditional dependency upon the package runtime/tk-8 so that it depends upon library/python/tkinter-26. So if tk-8 is installed then tkinter-26 will need to be installed.

  • Identify the incorporation that locks the package(s):

pkg search depend:incorporate:runtime/python-26

  • Using the information in the previous step find the relevant lock(s)

pkg contents -m userland-incorporation | egrep 'runtime/python-26|python/tkinter-26'

  • Unlock the package(s):

pkg change-facet version-lock.runtime/python-26=false version-lock.library/python/tkinter-26=false

  • Update the package(s) to the identified version from the first step:

pkg update runtime/python-26@2.6.8-0.175.3.15.0.4.0

No need to worry about tkinter-26 here because the dependency within the python-26 package will cause it to be installed.

  • Freeze the package(s) so that further updates will not remove them. Put a comment with the freeze to indicate why the package is installed:

pkg freeze -c 'Needed for Old Application' runtime/python-26

  • If, required, update the system to the later SRU or Oracle Solaris Update:

pkg update

Another complete example using the current Oracle Solaris 11.4 Beta and Java 7


# pkg list -af jre-7
NAME (PUBLISHER)                      VERSION           IFO
runtime/java/jre-7                    1.7.0.999.99      --o
runtime/java/jre-7                    1.7.0.191.8       ---
runtime/java/jre-7                    1.7.0.181.9       ---
runtime/java/jre-7                    1.7.0.171.11      ---
runtime/java/jre-7                    1.7.0.161.13      ---
...
# pkg search depend:incorporate:runtime/java/jre-7
INDEX       ACTION VALUE                                PACKAGE
incorporate depend runtime/java/jre-7@1.7.0.999.99,5.11 pkg:/consolidation/java-7/java-7-incorporation@1.7.0.999.99-0
# pkg contents -m java-7-incorporation|grep jre-7
depend fmri=runtime/java/jre-7@1.7.0.999.99,5.11 type=incorporate

Oh. There is no lock. What should we do now ? Is there a lock on the Java 7 incorporation that can be used ? Yes! See the results of the searching in the first command below. So we can unlock that one and install Java 7.


# pkg search depend:incorporate:consolidation/java-7/java-7-incorporation
INDEX       ACTION VALUE                                                  PACKAGE
incorporate depend consolidation/java-7/java-7-incorporation@1.7.0.999.99 pkg:/entire@11.4-11.4.0.0.1.12.0
# pkg contents -m entire | grep java-7-incorporation
depend fmri=consolidation/java-7/java-7-incorporation type=require
depend facet.version-lock.consolidation/java-7/java-7-incorporation=true fmri=consolidation/java-7/java-7-incorporation@1.7.0.999.99 type=incorporate
# pkg change-facet version-lock.consolidation/java-7/java-7-incorporation=false
            Packages to change:   1
     Variants/Facets to change:   1
       Create boot environment:  No
Create backup boot environment: Yes

PHASE                                          ITEMS
Removing old actions                             1/1
Updating package state database                 Done 
Updating package cache                           0/0 
Updating image state                            Done 
Creating fast lookup database                   Done 
Updating package cache                           1/1 
# pkg list -af java-7-incorporation
NAME (PUBLISHER)                             VERSION            IFO
consolidation/java-7/java-7-incorporation    1.7.0.999.99-0     i--
consolidation/java-7/java-7-incorporation    1.7.0.191.8-0      ---
consolidation/java-7/java-7-incorporation    1.7.0.181.9-0      ---
....
# pkg install --accept jre-7@1.7.0.191.8 java-7-incorporation@1.7.0.191.8-0
           Packages to install:   2
            Packages to update:   1
       Create boot environment:  No
Create backup boot environment: Yes

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                3/3       881/881    71.8/71.8  5.2M/s

PHASE                                          ITEMS
Removing old actions                             4/4
Installing new actions                     1107/1107
Updating modified actions                        2/2
Updating package state database                 Done 
Updating package cache                           1/1 
Updating image state                            Done 
Creating fast lookup database                   Done 
Updating package cache                           1/1 
# pkg freeze -c 'Needed for Old Application' java-7-incorporation
consolidation/java-7/java-7-incorporation was frozen at 1.7.0.191.8-0:20180711T215211Z
# pkg freeze
NAME                                      VERSION                        DATE                     COMMENT
consolidation/java-7/java-7-incorporation 1.7.0.191.8-0:20180711T215211Z 07 Aug 2018 14:50:34 UTC Needed for Old Application

A couple of points with the above example. When installing the required version of java the corresponding incorporation at the correct version needed to be installed. The freeze has been applied to the Java 7 incorporation because that is the package that controls the Java 7 package version. The default version of Java remains as Java 8 but that can be changed as per the next steps below via the use of mediators (see pkg(1) and look for mediator).


# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b12, mixed mode)
# /usr/jdk/instances/jdk1.7.0/bin/java -version
java version "1.7.0_191"
Java(TM) SE Runtime Environment (build 1.7.0_191-b08)
Java HotSpot(TM) Server VM (build 24.191-b08, mixed mode)
# pkg set-mediator -V 1.7 java
            Packages to change:   3
           Mediators to change:   1
       Create boot environment:  No
Create backup boot environment: Yes
PHASE                                          ITEMS
Removing old actions                             2/2
Updating modified actions                        3/3
Updating package state database                 Done 
Updating package cache                           0/0 
Updating image state                            Done 
Creating fast lookup database                   Done 
Updating package cache                           1/1 
# java -version
java version "1.7.0_191"
Java(TM) SE Runtime Environment (build 1.7.0_191-b08)
Java HotSpot(TM) Server VM (build 24.191-b08, mixed mode)

Another example of unlocking packages is the article More Tips for Updating Your Oracle Solaris 11 System from the Oracle Support Repository.

In summary Oracle Solaris 11 provides a single method to update all the operating system software via a pkg update but additionally allows for exceptions to be used to permit legacy applications to run.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services