Apt-cacher: Difference between revisions
(Explain pros and cons more explicitly) |
(→Available mirrors: Explain how to use apt-cacher with Debian mirrors) |
||
| Line 13: | Line 13: | ||
==Debian== | ==Debian== | ||
===Available mirrors=== | ===Available mirrors=== | ||
* ftp.uk.debian.org | * ftp.uk.debian.org | ||
* ftp.debian.org | * ftp.debian.org | ||
| Line 19: | Line 20: | ||
* backports.debian.org | * backports.debian.org | ||
* jonas.genannt.name | * jonas.genannt.name | ||
N.B. Some Debian documentation refers to deb.debian.org, which is a geo-IP redirecting to a local mirror near you. Wherever you see such a reference, in general you can substitute this host for a local mirror. Given that ftp.uk.debian.org is one of those local mirrors ''and'' it's in the list above, it means you can convert any deb.debian.org repository URL into an apt-cacher URL referencing ftp.uk.debian.org. So for example: | |||
deb http://deb.debian.org/debian buster-backports main | |||
becomes: | |||
deb http://ftp.uk.debian.org/debian buster-backports main | |||
which in turn becomes: | |||
deb http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ buster-backports main | |||
===apt-cacher URI=== | ===apt-cacher URI=== | ||
Revision as of 16:37, 9 May 2021
The apt-cacher service is a specialised web proxy for Debian-style archive mirrors. Users of Debian- or Ubuntu-based VPSes can use BitFolk's apt-cacher service to avoid having to use their own bandwidth to download packages that other users have already downloaded.
Overview
To make use of BitFolk's apt-cacher service all you need to do is prepend a string to the mirror URIs you would normally use. The correct string to use depends on whether you use Debian or Ubuntu.
| Only the specific mirrors listed below are allowed. If you use other sites in your sources.list then please let BitFolk support know and they will consider whether to add them. |
If for any reason you are not able to use the apt-cacher, it's fine to use a Debian mirror as normal; you'll just miss out on two small advantages:
- Downloads from apt-cacher do not count towards your data transfer quota. That was a bigger deal back in 2007 when customers had only 100GB/month to use, but not so much at the time of writing when it's 4TB.
- Downloads from apt-cacher will be quicker if another customer already downloaded the packages you wanted, since they'll be in the cache.
Debian
Available mirrors
- ftp.uk.debian.org
- ftp.debian.org
- security.debian.org
- archive.debian.org
- backports.debian.org
- jonas.genannt.name
N.B. Some Debian documentation refers to deb.debian.org, which is a geo-IP redirecting to a local mirror near you. Wherever you see such a reference, in general you can substitute this host for a local mirror. Given that ftp.uk.debian.org is one of those local mirrors and it's in the list above, it means you can convert any deb.debian.org repository URL into an apt-cacher URL referencing ftp.uk.debian.org. So for example:
deb http://deb.debian.org/debian buster-backports main
becomes:
deb http://ftp.uk.debian.org/debian buster-backports main
which in turn becomes:
deb http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ buster-backports main
apt-cacher URI
apt-cacher.lon.bitfolk.com/debian/
Example
For Debian squeeze:
deb http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ squeeze main
deb-src http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ squeeze main
deb http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ squeeze-updates main
deb http://apt-cacher.lon.bitfolk.com/debian/security.debian.org/ squeeze/updates main
Ubuntu
Available mirrors
- gb.archive.ubuntu.com
- archive.ubuntu.com
- security.ubuntu.com
apt-cacher URI
apt-cacher.lon.bitfolk.com/ubuntu/
Example
For Ubuntu 12.04.x LTS (Precise Pangolin):
deb http://apt-cacher.lon.bitfolk.com/ubuntu/gb.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://apt-cacher.lon.bitfolk.com/ubuntu/gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://apt-cacher.lon.bitfolk.com/ubuntu/security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
Other
- http://apt-cacher.lon.bitfolk.com/puppetlabs/apt.puppetlabs.com/
- http://apt-cacher.lon.bitfolk.com/torproject/deb.torproject.org/
Debugging
If you're having problems with the apt-cacher service then the first and most important thing to try is to see if the problem manifests itself when the apt-cacher is not used. apt-cacher cannot cache files that are missing, or perhaps the source mirror is unreachable. Just remove the apt-cacher URI from the start of your mirror URIs and try again. If the problem persists then it's a problem with the actual mirror itself, which is not operated by BitFolk.
If problems only manifest themselves when using the apt-cacher but not when using the actual mirror directly then there could be a problem that BitFolk should know about. Please repeat your apt-get command with debugging enabled:
# apt-get update -o Debug::Acquire::Http=true
and send the output to support. In the mean time, switch to using mirrors directly.
IPv6
The apt-cacher has an IPv6 address as well as an IPv4 address. By default Linux will try to use IPv6 addresses before IPv4 if it thinks it has global IPv6 connectivity. If your initial connections to the apt-cacher attempt to go over IPv6, fail with a long timeout and then work over IPv4 then it is likely that your VPS's IPv6 connectivity is broken. You may wish to contact support to help get it fixed, disable IPv6 or prefer IPv4.
Trivia
The apt-cacher service is actually provided using the apt-cacher-ng software.