安装软件的apt-fast怎么用?
Tofloor
poster avatar
星外之神
deepin
2016-12-11 17:35
Author
如题,求解
Reply Favorite View the author
All Replies
avatar
FZFZ
deepin
2016-12-11 18:57
#1
http://jingyan.baidu.com/article/37bce2be7563a91002f3a28d.html

在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
配置 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字符串中包含默认的镜像指定站点。使用apt-fast安装一个包
现在你就可以测试apt-fast的强大了。下面是使用apt-fast的示例:
   
代码如下:
apt-fast [apt-get options and arguments]    apt-fast [aptitude options and arguments]    apt-fast { { install | upgrade | dist-upgrade | build-dep | download  | source  } [ -y | --yes | --assume-yes | --assume-no ]   ... | clean }
使用apt-fast安装包:
   
代码如下:
$ sudo apt-fast install texlive-full
在当前目录下载软件包,但不安装:
   
代码如下:
$ sudo apt-fast download texlive-full
Ubuntu上使用apt-fast来加快apt-get下载的教程
如前面所示,apt-fast的并行下载是通过aria2完成的。你可以看到如下图般从多个镜像并行下载。
   
代码如下:
$ sudo netstat -nap | grep aria2c
Ubuntu上使用apt-fast来加快apt-get下载的教程
  请注意,apt-fast并没有加速"apt-get update"。并行下载只在"install", "upgrade", "dist-upgrage"和"build-dep"操作中触发。其余的操作,apt-fast就会简单地回到默认的包管理器apt-get或 aptitude。apt-fast有多快? 为了比较apt-fast和apt-get,我尝试在两个相同的Ubuntu实例上使用两种方法安装几个软件包。下面的图表展示了所有软件包安装的时间(单位为秒)。
Ubuntu上使用apt-fast来加快apt-get下载的教程
5
正如你所见到的,apt-fast确实比apt-get快(e.g. 快3--4秒),特别是安装庞大软件包的时候。
当然,安装性能的提高程度还依赖你上游因特网连通性。以我为例,我有富足的带宽来支持我的上游连接。这也是为什么我看到并行下载带来了成功的提高。
Reply View the author
avatar
星外之神
deepin
2016-12-11 20:06
#2
udfk007 发表于 2016-12-11 10:57
在Debian或Ubuntu上安装apt-fast
下面是在基于Debian的Linux上安装apt-fast的步骤Debian
代码如下:

deepin呢?
Reply View the author
avatar
FZFZ
deepin
2016-12-11 21:01
#3

deepin 基于debian,所以按debian来操作。
Reply View the author