Ubuntu – How do Remap-* statements work in apt-cacher-ng

aptapt-cacher-ngconfiguration

I've just started using apt-cacher-ng to cache my apt-get downloads. Whenever I start it I get this error:

WARNING: No URL list file matching file:backends_gentoo found in config or support directories.

Looking in /etc/apt-cacher-ng/acng.conf I see these lines:

# 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

I noticed that backends_debian, backends_ubuntu, and backends_debvol exist in /etc/apt-cacher/ng but backends_gentoo does not. If I create an empty file with that name then the error goes away although I'm not sure why this is.

I've looked in the manual as the comments suggest and it looks like the lines in the conf file are specifying either merges or redirects, thought I can't tell which one. I can't seem to understand what these Remap-* statements are for and if I need them or not? Also why were the other backend_* files automatically created but not the gentoo one?

Best Answer

Those are examples. Use only the ones you need to. I only use the Debian and Ubuntu configuration lines. From the manual, the syntax for the Remap directive:

Remap-RepositoryName: MergingURLs ; TargetURLs ; OptionalFlags

The MergingURLs are set of mirrors which are considered equivalent. I think this lets you mix and match mirror URLs in the client sources.list, but downloads usually will only take place from the URLs specified in TargetURLs. The lists of mirrors are provided with the package, and should be in the /usr/lib/apt-cacher-ng directory. The backends_* files are provided with package as well, presumably because this package is for Debian and Ubuntu, and people using it are likely going to use it for Debian and Ubuntu. The point of creating empty backend files eludes me, as does the reason behind the lack of complaints about the other files.