Adding and Updating Software in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Locking Packages to a Specified Version

Use the pkg freeze command to constrain a package version.

If no version is provided in the package operand, the named package must be installed and is constrained to the version installed on the system. If a version is provided in the package operand, then this constraint, or freeze, acts as if an incorporate dependency were installed where the fmri attribute had the value of the specified package version.

When a package that is frozen is installed or updated, it must end up at a version that matches the version at which it was frozen. For example, if a package was frozen at 1.2, then it could be updated to 1.2.1, 1.2.9, 1.2.0.0.1, and so on. That package could not end up at 1.3, or 1.1.

A publisher that is specified in the package operand is used to find matching packages. However, publisher information is not recorded as part of the freeze. A package is frozen with respect to its version only, not its publisher.

Freezing a package that is already frozen replaces the frozen version with the newly specified version.

If no packages are specified, the following information about currently frozen packages is displayed: package name, frozen version, when the package was frozen, and the reason the package was frozen.

Freezing a package does not prevent removal of the package. No warning is displayed if the package is removed.

In the following example, the package is frozen at the current installed version. The -c option argument is the reason the package is being frozen. The reason is shown if a freeze prevents an installation or update from succeeding. The “f” in the package listing indicates that the package is frozen.

$ pkg freeze -c "Downgrade to avoid bug" library/security/openssl
library/security/openssl was frozen at 1.0.0.10-0.175.1.0.0.18.0:20120611T201116Z
$ pkg freeze
NAME                     VERSION                                    DATE                     COMMENT
library/security/openssl 1.0.0.10-0.175.1.0.0.19.0:20120625T171753Z 29 Jul 2012 17:45:44 PDT Downgrade to
avoid bug
$ pkg list library/security/openssl
NAME (PUBLISHER)                    VERSION                    IFO
library/security/openssl            1.0.0.10-0.175.1.0.0.18.0  if-

When you try to install a different version of the frozen package, you see a message about the freeze.

$ pkg update library/security/openssl@1.0.0.10-0.175.1.0.0.20.0
Creating Plan (Solver setup): -
pkg update: No matching version of library/security/openssl can be installed:
  Reject: pkg://solaris/library/security/openssl@1.0.0.10,5.11-0.175.1.0.0.20.0:20120709T180243Z
  Reason:  This version is excluded by a freeze on library/security/openssl at version 
  1.0.0.10,5.11-0.175.1.0.0.18.0:20120611T201116Z.
  The reason for the freeze is: Downgrade to avoid bug

A freeze is never lifted automatically by the packaging system. Use the pkg unfreeze command to remove the constraints that freezing imposes from the specified packages. Any versions provided are ignored.