bin/173317: pkg doesn't work well with a proxy cache + frequent repo updates

Adam McDougall mcdouga9 at
Sat Nov 3 02:30:01 UTC 2012

>Number:         173317
>Category:       bin
>Synopsis:       pkg doesn't work well with a proxy cache + frequent repo updates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 03 02:30:01 UTC 2012
>Originator:     Adam McDougall
>Release:        9-STABLE amd64
FreeBSD test 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Fri Oct  5 10:17:48 EDT 2012     root at build9:/usr/obj/proto/src9/src/sys/AMD64-9  amd64
This may be more of a feature request than a bug report, but if possible, it would be helpful if pkg update worked better with a HTTP cache proxy which tends to deliver a cached repo.txz (at the least).  In my case I am using squid with a fairly basic configuration.  Is there a way for pkg to make HTTP requests so that the cache server will either not cache the files, or cache them shorter, or always verify with the real server if the file has changed instead of assuming it has not?  Eventually (for example the next day) the cache will assume the file is expired and fetch it for real, but I run into trouble when I make frequent repo updates and pkg update cannot see them because of the cache proxy.  I believe this applies to the package files too since their filenames don't change when rebuilt without a version bump.  If I recompile a package with new options, the old cached package will not match the checksum on a newly fetched repo.txz or vice versa.
setenv HTTP_PROXY=http://my.favorite.proxy:3128
pkg update
(put new repo and/or packages on the pkg server you are using)
pkg update
'Repository catalogue is up-to-date, no need to fetch fresh copy'
Workaround: don't use a caching proxy (unsetenv HTTP_PROXY), or find a way to fiddle with the proxy or client configuration so that it does not use the proxy for your pkg server, or doesn't cache files from your pkg server if it does proxy it.  Maybe pkg can send hints in its http requests to make a cache behave better.


More information about the freebsd-bugs mailing list