APT-TRANSPORT-HTTP(1)
๐ APT-TRANSPORT-HTTP ๐
okay so bestie, welcome to the manual page for apt-transport-http โ it's part of APT's docs, and it's literally all about downloading stuff over the Hypertext Transfer Protocol (HTTP). buckle up ๐
โจ NAME โจ
apt-transport-http โ the APT transport for downloading via the Hypertext Transfer Protocol (HTTP). yes that's the whole name, she's straightforward and I respect it ๐
๐ธ DESCRIPTION ๐ธ
So this APT transport lets you use repositories that you access via the Hypertext Transfer Protocol (HTTP). It comes available by default, and it's probably the most used of all the transports โ main character energy fr fr ๐.
Quick vibe check though: a transport is never called directly by a user. Nope. It gets used by APT tools based on your config. So don't try to summon her by hand, she shows up when she's needed โจ.
Now, the tea โ: HTTP is an unencrypted transport protocol, which means the whole communication with the remote server (or proxy) can be observed by a sufficiently capable attacker โ commonly referred to as a "man in the middle" (MITM) ๐ญ. BUT โ and this is the important part โ such an attacker cannot modify the communication to compromise the security of your system, because APT's data security model is independent of the chosen transport method. Iconic. The full explanation lives in apt-secure(8), and if you want an overview of all the available transport methods, that's in sources.list(5) ๐ฆ.
๐ OPTIONS ๐
You can set various options in an apt.conf(5) file to modify her behavior โ everything from proxy configuration to workarounds for specific server limitations. let's get into it ๐ซถ
๐ Proxy Configuration ๐
The environment variable http_proxy is supported for system wide configuration. Proxies that are specific to APT can be configured via the option Acquire::http::Proxy. And if you want a proxy used only for certain hosts, that's Acquire::http::Proxy::host ๐
.
Even more fine-grained control? That's proxy autodetection, detailed further below ๐. All these options use the URI format:
scheme://[[user][:pass]@]host[:port]/
Supported URI schemes are:
socks5hโ SOCKS5 with remote DNS resolutionhttphttps
Authentication details can be supplied via apt_auth.conf(5) instead of shoving them into the URI directly ๐ฅ.
The various APT configuration options support the special value DIRECT, which literally means no proxy should be used. The environment variable no_proxy is also supported for the same purpose ๐ง.
Furthermore, there are three settings provided for cache control with HTTP/1.1 compliant proxy caches:
Acquire::http::No-Cacheโ tells the proxy not to use its cached response under any circumstances.Acquire::http::Max-Ageโ sets the allowed maximum age (in seconds) of an index file in the cache of the proxy.Acquire::http::No-Storeโ specifies that the proxy should not store the requested archive files in its cache. super useful for preventing the proxy from polluting its cache with (big).debfiles ๐
๐ฆ Automatic Proxy Configuration ๐ฆ
Acquire::http::Proxy-Auto-Detect can be used to specify an external command to discover the HTTP proxy to use. The first and only parameter is a URI denoting the host to be contacted โ that's so you can do host-specific configuration ๐.
APT expects the command to output the proxy on stdout as a single line in the previously specified URI format, or the word DIRECT if no proxy should be used. And if there's no output at all? That indicates the generic proxy settings should be used โจ.
Heads up bestie: auto-detection will not be used for a host if a host-specific proxy configuration is already set via Acquire::http::Proxy::host. she respects the more specific setting, periodt.
See the squid-deb-proxy-client(1) and auto-apt-proxy(1) packages for example implementations ๐.
This option takes precedence over the legacy option name Acquire::http::ProxyAutoDetect โ the old name is still around but she's not the one in charge anymore ๐
.
๐ Connection Configuration ๐
Acquire::http::Timeoutโ sets the timeout timer used by the method. This value applies to the connection as well as the data timeout.Acquire::http::Dl-Limitโ limits the used bandwidth. It accepts integer values in kilobytes per second. The default value is0, which deactivates the limit and tries to use all available bandwidth ๐ฅ. Note that this option implicitly disables downloading from multiple servers at the same time โ one connection at a time, she's monogamous.Acquire::http::Pipeline-Depthโ enables HTTP pipelining (RFC 2616 section 8.1.2.2), which can be beneficial e.g. on high-latency connections. It specifies how many requests are sent in a pipeline. APT tries to detect and work around misbehaving webservers and proxies at runtime, but if you know yours doesn't conform to the HTTP/1.1 specification, pipelining can be disabled by setting the value to0. It is enabled by default with the value10โจ.Acquire::http::AllowRedirectโ controls whether APT will follow redirects. Enabled by default.Acquire::http::User-Agentโ lets you set a different User-Agent for the http download method, since some proxies only allow access for clients if the client uses a known identifier ๐.Acquire::http::SendAcceptโ enabled by default, and sends anAccept: text/*header field to the server for requests without file extensions, to prevent the server from attempting content negotiation ๐.
๐ EXAMPLES ๐
here's what it looks like all put together, slay:
Acquire::http {
Proxy::example.org "DIRECT";
Proxy "socks5h://apt:pass@127.0.0.1:9050";
Proxy-Auto-Detect "/usr/local/bin/apt-http-proxy-auto-detect";
No-Cache "true";
Max-Age "3600";
No-Store "true";
Timeout "10";
Dl-Limit "42";
Pipeline-Depth "0";
AllowRedirect "false";
User-Agent "My APT-HTTP";
SendAccept "false";
};
๐ SEE ALSO ๐
apt.conf(5) apt_auth.conf(5) sources.list(5)
go read those too, iykyk ๐ซถ
๐ BUGS ๐
Found a bug? Go check the APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. they'll help you out bestie, no need to suffer in silence ๐ญ
๐ธ AUTHOR ๐ธ
APT team โ the whole squad ๐
โญ NOTES โญ
- APT bug page https://bugs.debian.org/src:apt
and that's the page!! this gorgeous piece of documentation is from APT 3.3.5, dated 04 April 2019 โ yeah she's got a vintage vibe but she's still out here slaying ๐ โจ bye bestie, go download something ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: apt 3.3.5-1 ยท BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND MIT
- nixpkgs unstable: apt 3.3.5
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms