Remap-* 语句如何在 apt-cacher-ng 中工作?

Yep*_*_Me 4 configuration apt apt-cacher-ng

我刚刚开始使用apt-cacher-ng缓存我的 apt-get 下载。每当我启动它时,我都会收到此错误:

WARNING: No URL list file matching file:backends_gentoo found in config or support directories.
Run Code Online (Sandbox Code Playgroud)

看着/etc/apt-cacher-ng/acng.conf我看到这些行:

# Repository remapping. See manual for details.
# In this example, some backends files might be generated during package
# installation using information collected on the system.
# Examples:
Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives
Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here
Remap-sfnet:  file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here
Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux
Remap-fedora: file:fedora_mirrors # Fedora Linux
Remap-epel:   file:epel_mirrors # Fedora EPEL
Remap-slrep:  file:sl_mirrors # Scientific Linux
Remap-gentoo: file:gentoo_mirrors.gz /gentoo ; file:backends_gentoo # Gentoo Archives
Run Code Online (Sandbox Code Playgroud)

我注意到backends_debian, backends_ubuntu, 和backends_debvol存在于/etc/apt-cacher/ngbackends_gentoo不存在。如果我创建一个具有该名称的空文件,那么错误就会消失,尽管我不确定为什么会这样。

我已经按照评论的建议查看了手册,看起来 conf 文件中的行指定了合并或重定向,我以为我不知道是哪一个。我似乎无法理解这些Remap-*陈述的用途以及我是否需要它们?另外为什么backend_*自动创建了其他文件而不是 gentoo 一个?

mur*_*uru 5

这些都是例子。仅使用您需要的那些。我只使用 Debian 和 Ubuntu 配置行。从手册中,Remap指令的语法:

Remap-RepositoryName: MergingURLs ; TargetURLs ; OptionalFlags
Run Code Online (Sandbox Code Playgroud)

MergingURLs组被认为是等效的镜子。我认为这可以让您混合和匹配客户端中的镜像 URL sources.list,但下载通常只会从TargetURLs. 镜像列表随包提供,应该在/usr/lib/apt-cacher-ng目录中。这些backends_*文件也随包一起提供,大概是因为该包适用于 Debian 和 Ubuntu,而使用它的人很可能会将它用于 Debian 和 Ubuntu。创建空的后端文件的意义和其他文件缺乏投诉背后的原因一样,我不知道。