sudo apt-get install apt-p2p
2. 接著先備份軟體來源設定檔(source.list)
sudo cp /etc/apt/sources.list /etc/apt/sources.list-apt-p2p-backup
3. 編輯 souece.list 檔案,將每行的「http://」替換為「http://localhost:9977/」
sudo gedit /etc/apt/sources.list
deb http://localhost:9977/archive.ubuntu.com/ubuntu/ jaunty main universe restricted multiverse
deb http://localhost:9977/security.ubuntu.com/ubuntu/ jaunty-security universe main multiverse restricted
deb http://localhost:9977/ftp.twaren.net/ubuntu jaunty main universe restricted multiverse
……以下省略、依此類推……
4. 更新套件資訊
sudo apt-get update
此時已大功告成。好奇的話,可以使用瀏覽器開啟 http://localhost:9977/ 頁面,看看 apt-p2p 的運作狀況。
我的使用經驗是,有超過 98% 的流量會透過 apt-p2p 從其他 peers 那邊抓,只剩一點點會回到各個 Repository 那邊去下載。
代码: 全选
# deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Release i386 (20090420.1)]/ jaunty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ubuntu.cn99.com/ubuntu/ jaunty main restricted
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ubuntu.cn99.com/ubuntu/ jaunty-updates main restricted
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ubuntu.cn99.com/ubuntu/ jaunty universe
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty universe
deb http://ubuntu.cn99.com/ubuntu/ jaunty-updates universe
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ubuntu.cn99.com/ubuntu/ jaunty multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty multiverse
deb http://ubuntu.cn99.com/ubuntu/ jaunty-updates multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-updates multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://cn.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu jaunty partner
# deb-src http://archive.canonical.com/ubuntu jaunty partner
deb http://ubuntu.cn99.com/ubuntu/ jaunty-security main restricted
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-security main restricted
deb http://ubuntu.cn99.com/ubuntu/ jaunty-security universe
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-security universe
deb http://ubuntu.cn99.com/ubuntu/ jaunty-security multiverse
deb http://packages.medibuntu.org/ jaunty free non-free #medibuntu
deb http://ppa.launchpad.net/shutter/ppa/ubuntu jaunty main #shutter
deb-src http://ubuntu.cn99.com/ubuntu/ jaunty-security multiverse
deb http://us.archive.ubuntu.com/ubuntu edgy universe
deb http://wine.budgetdedicated.com/apt edgy main
deb http://dl.google.com/linux/deb/ stable non-free #google
#国外官方源P2P来升级Ubuntu
deb http://security.ubuntu.com/ubuntu/ jaunty-security universe main multiverse restricted
deb http://localhost:9977/archive.ubuntu.com/ubuntu/ jaunty main universe restricted multiverse
deb http://localhost:9977/archive.ubuntu.com/ubuntu/ jaunty-updates universe main multiverse restricted
deb http://localhost:9977/archive.ubuntu.com/ubuntu/ jaunty-backports universe main multiverse restricted
deb http://localhost:9977/archive.canonical.com/ubuntu jaunty partner
#Archive.ubuntu.com更新服务器(欧洲,此为官方源,电信网通用户使用):
deb http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse