2009年4月20日星期一

How to use apt-p2p For Faster Upgrades From Ubuntu Intrepid (8.10) to Jaunty (9.04)

April 13, 2009 ・ Package Mgmt ・ Email This Post

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If you want to upgrade From Ubuntu Intrepid (8.10) to Jaunty (9.04) use this tutorial for faster upgrades.We are going to use apt-p2p for this tutorial.apt-p2p is a p2p proxy for apt dowloads, it will act as a proxy between apt requests and a repository server, downloading any request files from peers (if possible), else will fallback to direct HTTP download. In general, apt-p2p save bandwidth, use limited cpu and memory resources and reduce congestion on the ubuntu mirrors.apt-p2p will get the request files from peers, therefore, it will avoid the congestion on the ubuntu mirrors.

Note:- This is only for advanced users this might break your system

Note: This is still a beta release. Do not install it on production machines. The final stable version will be released in 23rd April 2009.

apt-p2p features

  • Downloads from peers, increasing the available bandwidth to the user
  • Reduces the bandwidth requirements needed to setup a repository of packages
  • Seamlessly integrates with the current APT tool
  • Automatically falls back to downloading from an HTTP mirror when peers are not available
  • Builds on other already existing tools where possible
  • Fast and requires limited CPU and memory
  • Will try to download any file it can find a hash for from peers (including Packages.bz2, Sources.gz, …)

Install apt-p2p in ubuntu

sudo aptitude install apt-p2p

This will complete the installation.

Configuring apt-p2p

First you need to take a backup of your source list

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Edit sources.list file

gedit /etc/apt/sources.list

Add "localhost:9977? after the "http://" save and exit the file

deb http://localhost:9977/archive.canonical.com/ubuntu intrepid partner
deb-src http://localhost:9977/archive.canonical.com/ubuntu intrepid partner
deb http://localhost:9977/*mirror-address*/ubuntu/ intrepid main universe restricted multiverse
deb-src http://localhost:9977/*mirror-address*/ubuntu/ intrepid main universe restricted multiverse

So basically just insert "localhost:9977″ after the "http://" and where **mirror-address** is the address of the mirror

Now remove the cache files using the following command

sudo rm -rf /var/cache/apt-p2p/cache/*

Update the source list file using the following command

sudo apt-get update

Start upgrade from Interpid to Jaunty

sudo update-manager -d

If you want to Check peers, downloads and uploads speed and DHT statistics Open Internet browser,

go to http://localhost:9977