Adding and Updating Software in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Changing the Preferred Application

Use the pkg set-mediator command to reset the version of a specified mediation that is the default or preferred version.

Use the output from pkg mediator -a to select a version for the -V argument or an implementation for the -I argument. If you make a typographical error or otherwise specify a mediator version or implementation that is not currently available, any links that use the specified mediator are removed.

Use the -n option with the set-mediator subcommand to see whether a backup BE will be created. If no backup BE will be created, you can specify the --require-backup-be option with the set-mediator subcommand. The mediator change is made in the current BE. When you have determined that your current BE has no problems after the mediator change, you can use beadm destroy to destroy the backup BE.

The previous output showed that version 1.7 is the currently selected preferred version of the java mediation. The following command shows setting version 1.6 as the preferred version, which means that invoking /usr/bin/java will invoke JRE version 1.6. JRE version 1.7 is still available on the system when users specify the full path to that version. Compare the output of the two pkg mediator commands. When you changed the preferred version for the mediation, the VER. SRC. also changed to local, indicating that the selection was specified by an administrator. This selection will persist across reboots and package updates.

$ pkg mediator java
MEDIATOR VER. SRC. VERSION IMPL. SRC. IMPLEMENTATION
java     system    1.7     system
$ pkg mediator -a java
MEDIATOR    VER. SRC. VERSION IMPL. SRC. IMPLEMENTATION
java        system    1.7     system
java        system    1.6     system
$ pkg set-mediator -V 1.6 java
            Packages to update:  3
           Mediators to change:  1
       Create boot environment: No
Create backup boot environment: No

PHASE                                          ITEMS
Removing old actions                             2/2
Updating modified actions                        3/3
Updating image state                            Done
Creating fast lookup database                   Done
Reading search index                            Done
Updating search index                            3/3
$ pkg mediator java
MEDIATOR VER. SRC. VERSION IMPL. SRC. IMPLEMENTATION
java     local     1.6     system

This administrative selection is retained across package updates, even if the selected implementation is no longer installed. If the selected implementation is no longer installed, the target of the mediated link does not exist. Use one of the following methods to reset the preferred implementation:

  • Use the pkg set-mediator command again to select a different implementation from the updated list shown by pkg mediator -a.

  • Use the pkg unset-mediator command to allow the system to select a new implementation.

    $ pkg unset-mediator java