Ubuntugeek 上介绍了一个方法,通过一个名为 apt-fast 的脚本来让 axel 结合 apt-get 命令进行软件的安装,由于 axel 可以多线程下载软件包,这样就可以起到了加速的作用。
而且整个使用过程基本与 apt-get 无异,只需要把平常的 apt-get 改为 apt-fast 就可以了,比如 sudo apt-fast install package 。

# 安装与使用:
先安装 axel 工具
sudo apt-get install axel
从这里下载 apt-fast.sh 脚本,把它移动到 /usr/bin 目录中同时改名为 apt-fast 。
sudo cp apt-fast.sh /usr/bin/apt-fast
最后给予可执行权限
sudo chmod +x apt-fast
现在你就可以用 apt-fast 来代替 apt-get 了,比如 sudo apt-fast upgrade , sudo apt-fast dist-upgrade 等等。
7 Responses to Apt-fast : 用 axel 来加速 apt-get 软件安装
yawp
八月 8th, 2010 at 3:39 上午
这个脚本是有问题的,执行 apt-fast upgrade下载完第一个包之后,接着屏幕提示apt-get upgrade命令的提示,询问是否继续。如果回答y,又用apt-get把这个包再下载一边。而且每次执行apt-fast upgrade都只下载第一个包,然后又继续apt-get。
下载文件存放路径也有所不同,apt-fast 放在/var/cache/apt/archives/,软件包加个.0别名;而apt-get放在/var/cache/apt/archives/partial/
请看我刚才的升级情况,执行apt-fast upgrade几次,每次第一个包下载完了,然后又自动转回了apt-get(4.7M的那个包即apt-get没下载完的)
-rw-r--r-- 1 root root 4.7M 2010-08-08 11:17 ./cache/apt/archives/partial/xulrunner-1.9.2_1.9.2.9~hg20100806r34500+nobinonly-0ubuntu1~umd1~lucid_i386.deb
-rw-r--r-- 1 root root 9.0M 2010-08-08 10:17 ./cache/apt/archives/xulrunner-1.9.2_1.9.2.9~hg20100806r34500+nobinonly-0ubuntu1~umd1~lucid_i386.deb.0
-rw-r--r-- 1 root root 9.0M 2010-08-08 10:49 ./cache/apt/archives/xulrunner-1.9.2_1.9.2.9~hg20100806r34500+nobinonly-0ubuntu1~umd1~lucid_i386.deb.1
-rw-r--r-- 1 root root 9.0M 2010-08-08 11:03 ./cache/apt/archives/xulrunner-1.9.2_1.9.2.9~hg20100806r34500+nobinonly-0ubuntu1~umd1~lucid_i386.deb.2
[Reply]
riku Reply:
八月 8th, 2010 at 12:38 下午
没有吧,我这边好像挺正常的,我再看看吧,会不会出现你说的情况。
[Reply]
yawp Reply:
八月 8th, 2010 at 2:35 下午
那有可能是我系统(ubuntu10.04/kernel2.6.35)问题,下载好的.deb包放在/var/cache/apt/archives/partial/目录,不会添加到apt-get缓存,所以这个脚本里执行“apt-get upgrade”时,又重新下载了。
[Reply]
riku Reply:
八月 8th, 2010 at 2:37 下午
你的 kernel 到最新版?自已编译的? 官方貌似还没出啊。
[Reply]
yawp Reply:
八月 8th, 2010 at 3:06 下午
添加源就可以更新了(https://launchpad.net/~kernel-ppa/+archive/ppa),不过我是自己编译的,因为驱动不兼容。
我不确定是不是与内核更新有关, 之前没有这么操作apt-get。文件管理器pcmanfm确实是在昨天内核更新之后出现点击左侧标签就崩溃的现象,幸好今天这个软件有了新版本。
[Reply]
riku Reply:
八月 8th, 2010 at 3:11 下午
好的,谢谢!
[Reply]
» Apt-get 加速工具 Apt-fast 有 PPA 了 Wow! Ubuntu / Ubuntu 新闻、技巧、软件及游戏!
八月 19th, 2010 at 9:59 上午
[...] 有 PPA 了 19 Aug 2010 阅读次数: 0 (No Ratings Yet) Loading ... 还记得之前介绍过的 Apt-fast 工具吗?一个用 axel 来加速 apt-get 软件安装的脚本,现在这个工具有 PPA [...]