歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在Ubuntu環境下加速程序的安裝與升級

在Ubuntu環境下加速程序的安裝與升級

日期:2017/2/28 16:28:08   编辑:Linux教程

如果你是一位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.linuxidc.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 是如何進行下載的:

Copyright © Linux教程網 All Rights Reserved