Reinstalling an Image

por | 18 diciembre, 2016

If you know exactly what end result you want, and achieving that result requires a large number of packaging changes, such as uninstalling a large number of packages, you might want to use the pkg exact-install command. The result of the pkg exact-install command is an image with only the specified packages and their dependencies installed. Any currently installed packages that are not specified on the pkg exact-install command line and are not a dependency of the specified packages are removed.

A version of the entire incorporation package must be included in the exact-install operands. An image with no pkg:/entire installed is not supported. The version of the pkg:/entire package must be equal to or greater than the version of the currently installed pkg:/entire package.

The pkg exact-install command ignores restrictions to not install packages that are on the avoid list. If a package is on the avoid list, installing it removes it from that list. See Avoiding Installing Some Packages in a Group Package for information about the avoid list. The pkg exact-install command ignores restrictions to not update packages that are on the frozen list. See Locking Packages to a Specified Version for information about frozen packages.

Otherwise, the exact-install subcommand behaves the same way that the install subcommand behaves. Image variant and facet settings, image property settings, and publisher settings are retained. If any package cannot be installed in this image, then none of the specified packages is installed. Non-global zones are affected by any resulting package updates or removals as described in Working with Non-Global Zones. Note that the -r option is not available for exact-install.

See Installing a New Package for information about publisher stickiness and search order and about using the -g option.

The following practices are recommended for using the pkg exact-install command:

  • Check the versions of packages that are available from configured publishers by using pkg list -a as shown in Installable Packages. If you want to use exact-install to reinstall current versions, and newer versions are available to be installed, you must specify the version portion of the package FMRI in the list of packages to install.
  • Include the entire incorporation package in the list of packages to install.
  • Include one of the system group packages such as the solaris-minimal-server package in the list of packages to install.
  • Run the command first with the -nv or -nvv options to see exactly what will be installed and what will be removed.
  • Use the --be-name option to install into a new BE that has a meaningful name.

The following example creates a new image with a minimal installation at the same version as the current image:

$ pkg list -Hv entire
pkg://solaris/[email protected],5.11-0.175.2.0.0.34.0:20140303T182643Z
$ pkg exact-install --be-name s11.2 [email protected],5.11-0.175.2.0.0.34 solaris-minimal-server