Ubuntu更新系統(tǒng)備份軟體來源設(shè)定
Ubuntu更新系統(tǒng)的常用系統(tǒng),于是我學(xué)習(xí)研究了Ubuntu更新系統(tǒng),在這里對大家詳細(xì)介紹下Ubuntu更新系統(tǒng)應(yīng)用,希望對大家有用Ubuntu更新系統(tǒng)包含了非常好的翻譯和容易使用的架構(gòu).APT 是一套 Debian 所發(fā)展出來的套件管理系統(tǒng),Ubuntu更新系統(tǒng) Linux 也使用它來處理程式跟系統(tǒng)上的安裝、更新的工作。平常我們在 Ubuntu更新系統(tǒng) 上執(zhí)行更新管理員或 Synaptic 套件管理程式,背後就是透過 APT 在努力工作。
apt-p2p 能透過 p2p 的原理,從其他 apt-p2p 的使用者(peers)那邊取得需要的套件,有效減輕 Ubuntu更新系統(tǒng) 更新伺服器的負(fù)擔(dān),理論上也會(huì)更快。如果沒有其他人有你需要的套件,apt-p2p 會(huì)自動(dòng)回到原本的套件來源處下載。
因?yàn)閷W(xué)校的網(wǎng)路近來連接國外的速度頗慢,導(dǎo)致每次 Ubuntu更新系統(tǒng)更新都要花上個(gè)幾十分鐘、甚至幾小時(shí),因此今天來嘗試看看使用 apt-p2p 更新.
參考原文:Using apt-p2p For Faster Upgrades From Intrepid to Jaunty | blog.chenhow.net
1. 首先先安裝 apt-p2psudo apt-get install apt-p2p
2. 接著先備份軟體來源設(shè)定檔(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/Ubuntujaunty main universe restricted multiverse
- ……以下省略、依此類推……
4. 更新套件資訊sudo apt-get update此時(shí)已大功告成。好奇的話,可以使用瀏覽器開啟 http://localhost:9977/ 頁面,看看 apt-p2p 的運(yùn)作狀況。我的使用經(jīng)驗(yàn)是,有超過 98% 的流量會(huì)透過 apt-p2p 從其他 peers 那邊抓,只剩一點(diǎn)點(diǎn)會(huì)回到各個(gè) Repository 那邊去下載。
#2 回覆: 使用 apt-p2p 來更新系統(tǒng) Wayne Su 2009/4/30 20:46 為什麼要連到國外更新?國內(nèi)就有不少很快的 mirror 站啦,例如 http://ftp.twaren.net/Ubuntu更新系統(tǒng)/.
#3 回覆: 使用 apt-p2p 來更新系統(tǒng) ugp 2009/4/30 22:54 如果學(xué)校擋BT的話還可以用嗎?...
#4 回覆: 使用 apt-p2p 來更新系統(tǒng) Irvin 2009/5/1 2:10 Wayne Su: apt-p2p不只會(huì)對Ubuntu更新系統(tǒng)更新伺服器起作用,也可以對其他 repository 生效,例如 PPA。ugp: BT 在我們學(xué)校幾乎跑不動(dòng),看來 apt-p2p 似乎沒有影響。
我從下午跑到現(xiàn)在的狀態(tài)是:
Mirror Downloads 937KB 2.05% ← 真正從套件伺服器那邊下載的
Peer Downloads 43.8MB 97.95% ← 從其他 apt-p2p 使用者那邊下載的
Peer Uploads 20.0MB 44.77% ← 我上傳給其他使用者的
#5 回覆: 使用 apt-p2p 來更新系統(tǒng) Irvin 2009/5/1 2:56 剛剛發(fā)現(xiàn) apt-p2p 除了在安裝套件之外,還是會(huì)不斷的上傳檔案給其他 peers,因此來翻看看設(shè)定檔,調(diào)校一下。apt-p2p 的設(shè)定檔在 /etc/apt-p2p/apt-p2p.conf,以下是部份重要設(shè)定:
# 預(yù)設(shè)的 PortPORT = 9977
# 設(shè)定上傳速度限制,單位是KB,預(yù)設(shè)是 0 無限制UPLOAD_LIMIT = 10
# 如果某個(gè)檔案的擁有者少於 3 人,就會(huì)同時(shí)從伺服器下載,以提高速度MIN_DOWNLOAD_PEERS = 3
# 開不開放遠(yuǎn)端使用者看你的統(tǒng)計(jì)資訊頁面,預(yù)設(shè)是 yes,網(wǎng)址是 http://你的ip:9977REMOTE_STATS = no 接著重新啟動(dòng) apt-p2p 服務(wù):
sudo /etc/init.d/apt-p2p restart如果要把 apt-p2p 移除的話,請按照下述步驟進(jìn)行。
1. 移除 apt-p2p 套件:
- sudo apt-get remove apt-p2p
- sudo apt-get autoremove
2. 把 souece.list 還原:
- sudo gedit /etc/apt/sources.list
- # 將每行的 localhost:9977/ 刪除
- # deb http://localhost:9977/archive.Ubuntu更新系統(tǒng).com/Ubuntu更新系統(tǒng)/ jaunty main universe restricted multiverse
- deb http://larchive.Ubuntu更新系統(tǒng).com/Ubuntu更新系統(tǒng)/ jaunty main universe restricted multiverse
- # deb http://localhost:9977/security.Ubuntu更新系統(tǒng).com/Ubuntu更新系統(tǒng)/ jaunty-security universe main multiverse restricted
- deb http://security.Ubuntu更新系統(tǒng).com/Ubuntu更新系統(tǒng)/ jaunty-security universe main multiverse restricted
- ……以下省略、依此類推……
3. 最後刪除佔(zhàn)著硬碟空間的相關(guān)快?。?/P>
- sudo rm -r /var/cache/apt-p2p/cache/
- sudo apt-get update
【編輯推薦】