Tutorial on using Apt-fast to speed up apt-get downloads on Ubuntu systems

Source: Internet
Author: User
Tags zip

If you often feel that apt-get or aptitude packages are slow to install on Debian or Ubuntu systems, there are several ways to improve this situation. Have you considered changing the default mirror site that is being used? Do you have the possibility of excluding the upstream bandwidth of Internet connection as a bottleneck?

If not for these reasons, you can try a third option: using the Apt-fast tool. Apt-fast is actually a shell script container around apt-get and aptitude that speeds up the download of the package. Apt-fast essentially uses the ARIA2 download tool, which can download a file in a "block" way from multiple mirrors (like BitTorrent downloads).

Install Apt-fast on Debian or Ubuntu

The following steps are to install Apt-fast on Debian based Linux

Debian

The code is as follows:

$ 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

Ubuntu 14.04 and later

The code is as follows:

$ sudo add-apt-repository Ppa:saiarcot895/myppa

$ sudo apt-get update

$ sudo apt-get install Apt-fast

Ubuntu 11.04 to Ubuntu 13.10

The code is as follows:

$ sudo add-apt-repository ppa:apt-fast/stable

$ sudo apt-get update

$ sudo apt-get install Apt-fast

During installation, you will need to select a default package manager (e.g., apt-get. Aptitude) and set the remaining options. However, you can change the settings at any time by editing the configuration file/etc/apt-fast/conf.

Configure Apt-get

After the installation is complete, you need to configure a series of mirrors that Apt-fast uses in the/etc/apt-fast.conf.

You can find a series of debian/ubuntu mirrors in the URL below.

Debian:http://www.debian.org/mirror/list

Ubuntu:https://launchpad.net/ubuntu/+archivemirrors

After you have selected the images that are geographically close to you, you will need to add the selected mirrors to the/etc/apt-fast.conf in the following format.

The code is as follows:

$ sudo vi/etc/apt-fast.conf

Debian:

The code is as follows:

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:

The code is as follows:

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/')

As shown above, the individual mirrors for a particular file need to be separated by commas. You need to include the default mirror-specific site in the/etc/apt/sources.list mirrors string.

Install a package using Apt-fast

Now you can test the strength of the apt-fast. The following is an example of using Apt-fast:

The code is as follows:

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}

To install the package using the Apt-fast:

The code is as follows:

$ sudo apt-fast install Texlive-full

Download the package in the current directory, but not install:

The code is as follows:

$ sudo apt-fast download texlive-full

As shown earlier, Apt-fast's parallel downloads are done through aria2. You can see the following image to download from multiple mirrors in parallel.

Copy Code

The code is as follows:

$ sudo netstat-nap | grep aria2c

Note that Apt-fast does not speed up "apt-get update." Parallel downloads are only triggered in the "Install", "Upgrade", "Dist-upgrage", and "BUILD-DEP" operations. The rest of the operation, Apt-fast simply goes back to the default package Manager Apt-get or aptitude.

How fast is Apt-fast?

To compare apt-fast and Apt-get, I tried to install several packages using two methods on two identical Ubuntu instances. The following chart shows the time (in seconds) of all package installations.

As you can see, apt-fast is indeed faster than apt-get (e.g. 3--4 seconds), especially when installing large packages.

Of course, the increase in installation performance depends on your upstream Internet connectivity. In my case, I have plenty of bandwidth to support my upstream connection. That's why I see the success of concurrent downloads.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.