tool used to download packages?
D. Michael McIntyre
michael.mcintyre at rosegardenmusic.com
Wed Feb 7 07:35:47 UTC 2007
On Tuesday 06 February 2007 3:25 pm, Andy Harrison wrote:
> What tool is used by apt-get and/or dpkg to download packages or
> perform updates from deb repositories? Can it be changed to something
> else?
OK, you piqued my curiosity. The answer is to use the source, Luke.
apt-get source apt-get
Have a look in the methods/ directory. For example (this is the version in
Dapper):
// $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
It uses HTTP/1.1 and many of the fancy options there-in, such as
pipelining, range, if-range and so on.
It is based on a doubly buffered select loop. A groupe of requests are
fed into a single output buffer that is constantly fed out the
socket. This provides ideal pipelining as in many cases all of the
requests will fit into a single packet. The input socket is buffered
the same way and fed into the fd for the file (may be a pipe in future).
This double buffering provides fairly substantial transfer rates,
compared to wget the http method is about 4% faster. Most importantly,
when HTTP is compared with FTP as a protocol the speed difference is
huge. In tests over the internet from two sites to llug (via ATM) this
program got 230k/s sustained http transfer rates. FTP on the other
hand topped out at 170k/s. That combined with the time to setup the
FTP connection makes HTTP a vastly superior protocol.
##################################################################### */
--
D. Michael McIntyre
More information about the kubuntu-users
mailing list