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:

Tags: , , , ,

4 Comments to “Installing apt-p2p on Ubuntu”

  1. 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.

  2. 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.

  3. Banankage says:

    You can use the same procedure to enable apt-p2p on Debian.

  4. 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/ :-D

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.