Minimize Stored Image Metadata

Note:

Do not modify anything in the /var/pkg directory except by explicit instructions from Oracle Support or official Oracle documentation. Modification of /var/pkg or its contents can result in an unusable and unsupported system.

Do not manually remove anything from the /var/pkg directory. The /var/pkg directory holds metadata for the image and is used to manage image state and cache catalogs, for example.

The /var/pkg directory can get quite large. Make sure the flush-content-cache-on-success image property value is set to true. The value of the flush-content-cache-on-success property is true by default. When the value of flush-content-cache-on-success is true, cached files are removed when pkg install and pkg update operations complete successfully. If the flush-content-cache-on-success property is set to false, you can use the following command to reset the value to true:

$ pkg property flush-content-cache-on-success
PROPERTY                       VALUE
flush-content-cache-on-success False
$ pkg set-property flush-content-cache-on-success true
$ pkg property -H flush-content-cache-on-success
flush-content-cache-on-success True

Flushing the content cache (setting flush-content-cache-on-success to true) can cause some pkg operations to take longer to complete.

Non-global zones have a different cache, which you can set with the -c option of /usr/lib/pkg.sysrepo. You can set the maximum size of this cache with the -s option. See the pkg.sysrepo(8) man page.