在Ubuntu环境下加速程序的安装与升级


如果你是一位Ubuntu的资深用户,你应当已经知道了 apt-get 命令。apt-get 是一个命令行工具,常用于在Debian系列的Linux发行版(如最为流行的Ubuntu)中安装新的软件并对其进行更新。

Now, if you’re familiar with apt-get you would have probably noticed that apt-get downloads the files with a single connection. Now what if there was a way a file could be split up into multiple pieces and each piece could be downloaded independently, similar to what download managers such as FlashGet / Internet Download Manager would do ?

如果你熟悉 apt-get 的工作模式的话,你或许已经注意到 apt-get 是通过单一的连接來下载文件的。那么,如果现在有一种方式,将文件分割成许多部分,而每一个部分都可以被独立的下载,就如同一些下载工具,如 FlashGet, Internet Download Manager,那是否效率会更高一些呢?

Enter apt-fast. apt-fast is an apt-get supplement/replacement script by Matt Parnell. Basically apt-fast does pretty much the same thing as apt-get does, except that the download part of it is handled by axel. The result being that your program installation downloads finish faster. A lot faster. Up to 26-times, according to Matt.

请输入 apt-fast 命令吧。apt-fast 是由Matt Parnell所编写的一个apt-get增强或替代脚本程序。从根本上來说,apt-fast 与 apt-get 在功能上是几乎一致的,除了一件事情——它的下载功能是由 axel 进行操作的。这样做的结果,便是你的程序安装文件可以被更快的下载下来。事实上,是非常非常快。www.bkjia.com根据Matt的测试,其速度可以高达原先的26倍。

Here are the steps in setting up apt-fast:

以下是设置 apt-fast 的几步流程:

Install axel

安装 axel

Even though apt-fast can detect and auto-install axel if it’s not installed, let’s do it by ourselves. As usual, it’s apt-get to the rescue.

尽管 apt-fast 可以检测并自动安装 axel, 如果axel尚未被安装的话,但我们还是自己动手來做吧。与通常的情况一样,我们使用 apt-get 來安装axel:

sudo apt-get install axel

sudo apt-get install axel

Download apt-fast script

下载 apt-fast 脚本程序

Download apt-fast.sh from here. Save it to your home directory.

点击这里下载 apt-fast.sh,并保存到你的个人文件夹中。

Setup apt-fast

安装 apt-fast

Before we can start using apt-fast we need so setup certain things – permissions and the like. First, move apt-fast to /usr/bin

在开始使用 apt-fast 之前,我们还需要做一些设置工作——运行权限及其相关。首先,将 apt-fast 文件移动到 /usr/bin 目录下:

sudo mv ~/apt-fast.sh /usr/bin/apt-fast

sudo mv ~/apt-fast.sh /usr/bin/apt-fast

Note: sudo is required here since a regular user does not have permissions to write to /usr/bin directory.

注意:sudo 命令是必需的,因为普通用户是没有对 /usr/bin 目录进行写入操作的权限的。

Give permissions to apt-fast to make it executable

赋予 apt-fast 以可执行权限:

sudo chmod +x /usr/bin/apt-fast

sudo chmod +x /usr/bin/apt-fast

Wrapping it up

开始工作吧!

That’s about all that is required to setup apt-fast. So now, instead of using apt-get to install software, just use apt-fast. Axel will download the software, and apt-get will perform the installation. The below screenshot should how the downloads look like now.

以上就是安装 apt-fast 的所有步骤了。现在,你便可以使用 apt-fast 來替代原来的 apt-get 进行软件的安装工作了。Axel会将软件下载下来,然后再交由 apt-get 來完成本地的安装工作。下面的这幅截图会告诉你 apt-fast 是如何进行下载的:

Ubuntu

相关内容