What packages do I need?

On debian-based systems, you will need the following packages:

  • python (>= 2.4)
  • python-twisted-core (>= 2.4)
  • python-twisted-web2 (>= 0.2.0)
  • python-apt (>= 0.6.20)

Does Apt-P2P require testing/unstable to work?

Short answer: yes. The only package missing from etch/stable is python-apt 0.6.20 (etch has it, but it's 0.6.19), so if you can install that you might get it working. I have not tested it with the twisted environment in etch/stable, which has an older version of twisted-web2 than testing/unstable, so I'm not sure it will work.

Will Apt-P2P work with other distributions/Ubuntu?

Yes, as long as the required packages are installed.

What about DebTorrent, how do the 2 compare?

Apt-P2P is quite different from DebTorrent in that it uses a Distributed Hash Table (DHT) to lookup peers that have files. It is not based on BitTorrent at all, except that the downloading of data from peers uses methods inspired by BitTorrent.


What happens if there's no peer that has the package I want?

Apt-P2P has a backup download method built into it that will use an HTTP mirror to download the file. This method will only be used if no peers can be found that have the file.

Port Forwarding

Do I need to forward ports?

Yes, you definitely do. Due to the use of a DHT built on UDP, peers must be able to contact each other. If a peer is not able to contact you, it will drop connections to you in the DHT. This will adversely affect your ability to lookup files in the DHT.

What ports should I forward?

The ports the Apt-P2P client listens on are configurable in the config file: apt-p2p.conf. You must have one TCP and one UDP port available for use by Apt-P2P, but they may be the same port. The default is to use port 9977 for both TCP and UDP.

How do I forward ports?

It depends on your router. The Wikipedia page recommends this site for HowTos, and this one for testing.

Hosting a Repository

Do I need to do anything special?

Not really. Apt-P2P builds on the HTTP repository idea that is used extensively in Debian. There are many packages available that make setting up a repository quite easy. For example: reprepro and debmirror.

Once you have an HTTP repository, you can ask that your users install Apt-P2P and change their sources.list files as described in Install.

Can I only offer packages via Apt-P2P?

No. The HTTP mirror is required for peers to use when they can't find a file in any peers.

If you want to only allow Apt-P2P users to download from your HTTP mirror, you could deny access to all but the Apt-P2P user-agent. Here are some instructions to do this in apache. It's not completely reliable, but should prevent most people from accessing your mirror directly. The user-agent Apt-P2P uses is something like:

apt-p2p/<version> (twisted/<version> twisted.web2/<version>)