避免在 apt-cacher-ng 服务器上使用 -dbg_version 包

5 apt-cacher

简介:我们创建了一个apt-cacher-ng服务器来为安装了 Ubuntu 14.04 的用户提供缓存包。结合缓存的包,我们正在使用该PrecacheFor参数对某些 Ubuntu 更新 uri 进行每周“镜像” 。以下正则表达式将创建所有更新存储库的镜像:

PrecacheFor: uburep/dists/trusty-updates/*/binary-amd64/Packages*
Run Code Online (Sandbox Code Playgroud)

但是,它会缓存调试包,这些包非常臃肿并且没有用。示例 html 日志输出:

Downloading uburep/pool/main/c/ceph/librbd1-dbg_0.80.5-0ubuntu0.14.04.1_amd64.deb...
<i>(6234KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-base_4.2.6.3-0ubuntu1_amd64.deb...
<i>(1380KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-base-core_4.2.6.3-0ubuntu1_amd64.deb...
<i>(715KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-base-drivers_4.2.6.3-0ubuntu1_amd64.deb...
<i>(515KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-calc_4.2.6.3-0ubuntu1_amd64.deb...
<i>(5779KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-common_4.2.6.3-0ubuntu1_all.deb...
<i>(19345KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-core_4.2.6.3-0ubuntu1_amd64.deb...
<i>(27243KiB)</i>

Downloading uburep/pool/main/libr/libreoffice/libreoffice-dbg_4.2.6.3-0ubuntu1_amd64.deb...
Run Code Online (Sandbox Code Playgroud)

问题:有没有办法使用 uri regex 的-dbg_任何选项apt-cacher-ng或使用 uri regex将子字符串包从下载中排除?

hru*_*ing 0

尝试查看DontCacheDontCacheRequestedDontCacheResolved指令。例如,类似:

DontCache (^|.*?/).+?-dbg_[0-9]
Run Code Online (Sandbox Code Playgroud)

文档说这会阻止文件被下载和缓存,但它没有阐明DontCache和之间的交互PreCacheFor