I decided to try out apt-p2p, since it’s a fun idea and an easy way to contribute to the community.
What is apt-p2p?
apt-p2p is a proxy between the normal apt interface, used by apt-get, aptitude and synaptic, and the bittorrent network. It uses an Distributed Hash Table instead of a bittorrent tracker, to keep track of the peers and files in the system. A couple of neat features of apt-torrent:
- Automatically falls back to downloading from a HTTP mirror when the package is not available via bittorrent.
- Will try to download any file it can find a hash for from peers (including Packages.bz2, Sources.gz, …) – not only debian (ubuntu) packages.
The installation is pretty simlpe, just follow the steps below:
sudo apt-get install apt-p2p
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo sed -i 's%http://%http://127.0.0.1:9977/%g' /etc/apt/sources.list
sudo rm -rf /var/cache/apt-p2p/cache/*
sudo apt-get update
Now to test the download speed, I installed the game Battle for Wesnoth, since it requires some 232MB to be downloaded:
sudo apt-get install wesnoth
It worked. An average download speed of 473kB/s was achieved, which isn’t so bad.
Related posts:
- Setting up CUDA development in Ubuntu 9.04
- Installing HTTP AntiVirus Proxy (HAVP) to protect your computers from viruses
- Downloading YouTube videos using Debian or Ubuntu
- Installing xubuntu 8.04 on the Medion Akoya E1210
- Improving randomness and entropy in ubuntu 9.10
Tags: apt-p2p, bittorrent, howto, linux, ubuntu





I never knew about this. Would have been useful to know about when 9.10 came out – the repositories were hit hard! If more people knew about this – or better yet it was used by default – we would no longer have to worry about killing the servers with our distro upgrades.
I think somebody suggested that it should be implemented in 9.10, but the idea was down-voted.
But I think it should be made easier to enable, after all, most ordinary people won’t go through the trouble of enabling apt-pt2 by hand.
You can use the same procedure to enable apt-p2p on Debian.
Hah, I never thought about using it on my debian machines, but now I’ve installed it on my server and my laptop, check out some stats here: http://bredsaal.dk:9977/