Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use apt-fast on Ubuntu systems to speed up apt-get downloads

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use apt-fast on the Ubuntu system to speed up the apt-get download". The content in the article is simple and clear, easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use apt-fast on the Ubuntu system to speed up the apt-get download".

If you often feel that the installation of apt-get or aptitude packages is too slow on Debian or Ubuntu systems, here are several ways to improve this situation. Have you ever considered changing the default mirror site that is being used? Have you ruled out the possibility that the upstream bandwidth of the Internet connection becomes a bottleneck?

If it's not for these reasons, you can try the third option: use the apt-fast tool. Apt-fast is actually a shell script container written around apt-get and aptitude that speeds up package downloads. Apt-fast essentially uses the aria2 download tool, which can download a file in parallel from multiple images in a "block" manner (like BitTorrent downloads).

Install apt-fast on Debian or Ubuntu

Here are the steps to install apt-fast on a 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 need to select a default package manager (e.g.apt-get. Aptitude), and the remaining options need to be set. But 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 images used by apt-fast in / etc/apt-fast.conf.

You can find a series of Debian/Ubuntu images in URL below.

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

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

After selecting the images that are geographically close to you, you need to add the selected images to / 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, individual images of a particular file need to be separated by commas. You need to include the default mirror specified site in the MIRRORS string of / etc/apt/sources.list.

Install a package using apt-fast

Now you can test the power of apt-fast. Here 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}

Install the package using apt-fast:

The code is as follows:

$sudo apt-fast install texlive-full

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

The code is as follows:

$sudo apt-fast download texlive-full

As shown earlier, the parallel download of apt-fast is done through aria2. You can see parallel downloads from multiple images as shown below.

The code is as follows:

$sudo netstat-nap | grep aria2c

Note that apt-fast does not speed up "apt-get update". Parallel downloads are triggered only in "install", "upgrade", "dist-upgrage" and "build-dep" operations. For the rest, apt-fast simply returns 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 chart below shows the installation time (in seconds) of all packages.

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

Of course, the improvement of installation performance also depends on your upstream Internet connectivity. In my case, I have plenty of bandwidth to support my upstream connection. That's why I see successful improvements from parallel downloads.

Thank you for reading, the above is "how to use apt-fast on the Ubuntu system to speed up apt-get download" content, after the study of this article, I believe you on how to use apt-fast on the Ubuntu system to speed up apt-get download this problem has a deeper understanding, the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report