Reverting Tagged Files and Directories

Use the --tagged option to perform the following operations:

  • Revert all files tagged with the specified tag name.

  • Remove any unpackaged files or directories that are under directories with the specified tag name and that match the specified pattern.

See the description of the revert-tag attribute in File Actions in Packaging and Delivering Software With the Image Packaging System in Oracle Solaris 11.4 and Directory Actions in Packaging and Delivering Software With the Image Packaging System in Oracle Solaris 11.4 for more information.

The following example shows directories that are tagged with the system:sysconfig-profile tag name. Unpackaged files will be removed from these directories when you use the --remove-profiles option with the sysconfig unconfigure command, as described in the sysconfig(8) man page.

$ pkg contents -H -a revert-tag='system:sysconfig-profile*' '*'
etc/svc/profile/enterprise
etc/svc/profile/incoming
etc/svc/profile/node
etc/svc/profile/site
etc/svc/profile/sysconfig
etc/svc/profile/system

The following command shows files that are tagged with the system:dev-init tag name. These files are reverted to their packaged state during recovery archive creation because these files contain configuration that is specific to that system and should not be included in a recovery archive. See the archiveadm(8) man page for more information.

$ pkg contents -Ha revert-tag='system:dev-init*' '*'

The following files are reverted to their packaged state during clone archive creation. In addition to the instance-specific information described in the previous example, information such as log file content and some configuration files also is reverted in a clone archive.

$ pkg contents -H -a revert-tag='system:dev-init*' -a revert-tag='system:clone*' '*'

The following command shows a preview of an operation that would revert all files that have the system:dev-init tag name. The files to be reverted would be listed by the -v option but are not shown in this example. Notice that the boot archive would be rebuilt. Using the --be-name option to create a new boot environment with a meaningful name is a good practice.

$ pkg revert -nv --tagged system:dev-init
               Packages to fix:         5
     Estimated space available: 852.20 GB
Estimated space to be consumed: 470.42 MB
       Create boot environment:       Yes
     Activate boot environment:       Yes
Create backup boot environment:        No
          Rebuild boot archive:       Yes