X

News, tips, partners, and perspectives for the Oracle Solaris operating system

IPS Cache

Guest Author

As I continued to experiment with my local repository mirror, I noticed downloads from the remote repository were running as quickly as from the local repository. Well, I was actually installing and uninstalling the same package to compare speeds and it turns out the files were not actually being downloaded from either repository, but rather copied from a local cache in /var/pkg/download

You see, the first time you install a package, it is first copied from the repository to your /var/pkg/download folder and then installed from there. Over time, the size of this folder can grow pretty big. For example, mine was over 3 gigabytes:

bleonard@os200906:~$ du -hs /var/pkg/download/
3.3G    /var/pkg/download/

Note, because there's so many files, the du command takes several minutes to complete.

Fortunately, this cache can be disabled through a property setting. To see the image's current properties, run pkg property:

bleonard@os200906:~$ pkg property
PROPERTY VALUE
send-uuid True
preferred-publisher opensolaris.org
require-optional False
flush-content-cache-on-success False
display-copyrights True
pursue-latest True

Setting the flush-content-cache-on-success property to true will delete your cache on the next successful IPS command:

bleonard@os200906:~$ pfexec pkg set-property flush-content-cache-on-success true
bleonard@os200906:~$ pfexec pkg install SUNWgnome-hex-editor
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 28/28 0.21/0.21
PHASE ACTIONS
Install Phase 83/83
Deleting content cache

After which you will no longer even have a download directory in /var/pkg.

Note, if you're turning off the cache to save space (as I am), you'll also need to delete the cache from any other boot environments you may have. In those cases, assuming you are not actively using those boot environments, you can just delete the /var/pkg/download directory.

Join the discussion

Comments ( 5 )
  • Sesli Chat Wednesday, September 9, 2009

    Nice work great article thank you for the post.


  • vermaden Thursday, September 10, 2009

    IMHO it would be better to provide option that would allow limit the cache space, for example, to 1GB then only alowing it being ON or OFF.

    We can of course create our own scripts for that 1GB setting, but going this way, we can create scripts for almost everything ... ;)


  • guest Thursday, October 1, 2009

    ?


  • shmerl Wednesday, November 4, 2009

    Is IPS cache setting persistent? It seems it was triggered back to false after the update to next release.


  • Sam C Tuesday, February 9, 2010

    A question for you -- would it be safe to NFS mount the global zone's /var/pkg/download from my non-global zones, so they can sll share the same download cache? I've got dedup turned on so it's not going to save me any disk, but it'd be nice to only do downloads once ;)


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.