大家好,关于极速蜗牛国语版很多朋友都还不太明白,今天小编就来为大家分享关于极速蜗牛的知识,希望对各位有所帮助!
如果你在Debian或Ubuntu系统上经常感觉到apt-get或aptitude包安装速度过慢,那么这里就有几种改善这一情况的方法。你有没有考虑过改变正被使用的默认镜像站点?你有没有排除因特网连接的上游带宽成为瓶颈的可能?
如果不是这些原因,你可以尝试第三个选择:使用apt-fast工具。apt-fast实际上是一个围绕apt-get和aptitude所写的shell脚本容器,它能加速包的下载速度。apt-fast本质上采用aria2下载工具,这款工具能够以“块”的方式从多个镜像并行下载一个文件(就像BitTorrent下载)。
在Debian或Ubuntu上安装apt-fast
下面是在基于Debian的Linux上安装apt-fast的步骤
$sudoapt-getinstallaria2n$wgethttps://github.com/ilikenwf/apt-fast/archive/master.zipn$unzipmaster.zipn$cdapt-fast-mastern$sudocpapt-fast/usr/binn$sudocpapt-fast.conf/etcn$sudocp./man/apt-fast.8/usr/share/man/man8n$sudogzip/usr/share/man/man8/apt-fast.8n$sudocp./man/apt-fast.conf.5/usr/share/man/man5n$sudogzip/usr/share/man/man5/apt-fast.conf.5n
Ubuntu14.04以及更高版本
$sudoadd-apt-repositoryppa:saiarcot895/myppan$sudoapt-getupdaten$sudoapt-getinstallapt-fastn
Ubuntu11.04到Ubuntu13.10
$sudoadd-apt-repositoryppa:apt-fast/stablen$sudoapt-getupdaten$sudoapt-getinstallapt-fastn
在安装期间,你需要选择一个默认的软件包管理器(e.g.,apt-get.aptitude),还需要设置其余选项。但是你可以随时通过编辑配置文件/etc/apt-fast/conf来更改设置。
安装完成后,你需要在/etc/apt-fast.conf里配置apt-fast使用的一系列镜像。
你可以在下面的URL中找到一系列Debian/Ubuntu镜像。
选择完那些地理上靠近你的镜像后,你需按照下面的格式将选择的镜像加入到/etc/apt-fast.conf。
$sudovi/etc/apt-fast.confn
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/')n
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/')n
如上面所示,对于一个特定档案的个别镜像,需要用逗号分割开来。你需要在/etc/apt/sources.list的MIRRORS字符串中包含默认的镜像指定站点。
现在你就可以测试apt-fast的强大了。下面是使用apt-fast的示例:
apt-fast[apt-getoptionsandarguments]napt-fast[aptitudeoptionsandarguments]napt-fast{{install|upgrade|dist-upgrade|build-dep|download|source}[-y|--yes|--assume-yes|--assume-no]...|clean}n
使用apt-fast安装包:
$sudoapt-fastinstalltexlive-fulln
在当前目录下载软件包,但不安装:
$sudoapt-fastdownloadtexlive-fulln
如前面所示,apt-fast的并行下载是通过aria2完成的。你可以看到如下图般从多个镜像并行下载。
$sudonetstat-nap|greparia2cn
请注意,apt-fast并没有加速"apt-getupdate"。并行下载只在"install","upgrade","dist-upgrage"和"build-dep"操作中触发。其余的操作,apt-fast就会简单地回到默认的包管理器apt-get或aptitude。
为了比较apt-fast和apt-get,我尝试在两个相同的Ubuntu实例上使用两种方法安装几个软件包。下面的图表展示了所有软件包安装的时间(单位为秒)。
正如你所见到的,apt-fast确实比apt-get快(e.g.快3--4秒),特别是安装庞大软件包的时候。
当然,安装性能的提高程度还依赖你上游因特网连通性。以我为例,我有富足的带宽来支持我的上游连接。这也是为什么我看到并行下载带来了成功的提高。
作者:DanNanni译者:su-kaiyao校对:wxy
本文由LCTT原创翻译,Linux中国荣誉推出
本文是原创投递或翻译投递,Linux中国首发地址:http://linux.cn/article-4246-1.html
欢迎转载,敬请在正文中标注并保留原文/译文链接和作者/译者等信息
好了,文章到此结束,希望可以帮助到大家。
本文由欣欣吧手游攻略栏目发布,感谢您对欣欣吧的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人站长或者朋友圈,但转载请说明文章出处“极速蜗牛国语版?极速蜗牛”