如果你在Debian或Ubuntu系統上經常感覺到apt-get 或 aptitude包安裝速度過慢,那麼這裡就有幾種改善這一情況的方法。你有沒有考慮過改變正被使用的默認鏡像站點?你有沒有排除因特網連接的上游帶寬成為瓶頸的可能?
如果不是這些原因,你可以嘗試第三個選擇:使用apt-fast工具。apt-fast實際上是一個圍繞apt-get和aptitude所寫的shell腳本容器,它能加速包的下載速度。apt-fast本質上采用aria2下載工具,這款工具能夠以“塊”的方式從多個鏡像並行下載一個文件(就像BitTorrent下載)。
apt-fast - 用axel讓apt-get多線程加速軟件安裝 http://www.linuxidc.com/Linux/2011-01/31815.htm
Ubuntu的apt加速工具:apt-fast http://www.linuxidc.com/Linux/2011-04/35020.htm
安裝apt-fast加快你的apt-get 下載速度 http://www.linuxidc.com/Linux/2011-07/38034.htm
apt-fast:飛一般的apt-get http://www.linuxidc.com/Linux/2013-10/91797.htm
使用apt-fast 來加速你的Ubuntu 的apt http://www.linuxidc.com/Linux/2013-11/92849.htm
在Debian或Ubuntu上安裝apt-fast
下面是在基於Debian的Linux上安裝apt-fast的步驟
Debian
- $ sudo apt-get install aria2
- $ wget https://github.com/ilikenwf/apt-fast/archive/master.zip
- $ unzip master.zip
- $ cd apt-fast-master
- $ sudo cp apt-fast /usr/bin
- $ sudo cp apt-fast.conf /etc
- $ sudo cp ./man/apt-fast.8/usr/share/man/man8
- $ sudo gzip /usr/share/man/man8/apt-fast.8
- $ sudo cp ./man/apt-fast.conf.5/usr/share/man/man5
- $ sudo gzip /usr/share/man/man5/apt-fast.conf.5
Ubuntu 14.04 以及更高版本
- $ sudo add-apt-repository ppa:saiarcot895/myppa
- $ sudo apt-get update
- $ sudo apt-get install apt-fast
Ubuntu 11.04 到 Ubuntu 13.10
- $ sudo add-apt-repository ppa:apt-fast/stable
- $ sudo apt-get update
- $ sudo apt-get install apt-fast
在安裝期間,你需要選擇一個默認的軟件包管理器 (e.g., apt-get. aptitude ),還需要設置其余選項。但是你可以隨時通過編輯配置文件 /etc/apt-fast/conf 來更改設置。
配置 apt-get
安裝完成後,你需要在/etc/apt-fast.conf裡配置apt-fast使用的一系列鏡像。
你可以在下面的URL中找到一系列Debian/Ubuntu鏡像。
- Debian: http://www.debian.org/mirror/list
- Ubuntu: https://launchpad.net/ubuntu/+archivemirrors
選擇完那些地理上靠近你的鏡像後,你需按照下面的格式將選擇的鏡像加入到/etc/apt-fast.conf。
- $ sudo vi /etc/apt-fast.conf
Debian:
- MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/')
Ubuntu/Mint:
- MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/')
如上面所示,對於一個特定檔案的個別鏡像,需要用逗號分割開來。你需要在/etc/apt/sources.list的MIRRORS字符串中包含默認的鏡像指定站點。
更多詳情見請繼續閱讀下一頁的精彩內容: http://www.linuxidc.com/Linux/2014-11/109526p2.htm