GithubHelp home page GithubHelp logo

samgaw-archive / apt-metalink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tatsuhiro-t/apt-metalink

0.0 2.0 0.0 31 KB

Make 'apt-get' faster by downloading Debian/Ubuntu packages from multiple servers concurrently.

License: GNU General Public License v3.0

Python 100.00%

apt-metalink's Introduction

apt-metalink

apt-metalink makes apt-get faster by downloading Debian/Ubuntu packages from several servers concurrently. apt-metalink uses python-apt to interface apt infrastructure and aria2 for download backend. Metalink is used to feed package list to aria2.

If multiple debian mirror is specified in /etc/apt/sources.list, packages are usually available in more than one server. apt-get only uses 1 URI to download package in sequential manner. apt-metalink uses the advantage of availability of these mirrors. apt-metalink establishes 1 connection per mirror and downloads packages from all mirrors in sources.list. This is as if running apt-get with different mirror and mutually exclusive subset of packages at the same time. This parallelism shortens whole download time. The difference of parallel transfer and sequential transfer gets bigger when the number of packages to download increases. The connection to the remote server is reused across the download, so it is very efficient.

Prerequisites

apt-metalink uses aria2 as download backend. You can install aria2 with following command:

apt-get install aria2

I strongly recommend to use the latest release of aria2. You can download aria2 from https://aria2.github.io/

apt-metalink also depends on python-apt package. You can install python-apt with following command:

apt-get install python-apt

But I think it is usually already in your system. If you see that apt-metalink reports there are packages to update but the total size is 0 byte, then it is a sign that python-apt needs to be updated. Please update python-apt first in this case.

Edit sources.list

sources.list is ususally located at /etc/apt/sources.list. Add several fast debian mirror server to it. Don’t add slow mirror. It voids the power of apt-metalink. For example, adding 3 debian mirror:

deb http://MIRROR1/debian/ unstable main contrib non-free
deb http://MIRROR2/debian/ unstable main contrib non-free
deb http://MIRROR3/debian/ unstable main contrib non-free

See sources.list(5) for more details.

apt-metalink uses them all and download packages concurrently, which makes download faster.

Currently, apt-metalink passes the number of mirrors as -j option to aria2c.

Usage

  Usage: apt-metalink [options] {upgrade | dist-upgrade | install pkg ...}

  Options:
    -h, --help            show this help message and exit
    -d, --download-only   Download only. [default: False]
    --print-metalink      Instead of fetching the files, Metalink XML document
                          is printed. Metalink XML document contains package's
                          URIs and checksums.
    --hash-check          Check hash of already downloaded files. If hash check
                          fails, download file again.
    -x ARIA2C, --aria2c=ARIA2C
                          path to aria2c executable [default: /usr/bin/aria2c]

Currently, apt-metalink offers very basic subset of features that apt-get has: upgrade, dist-upgrade and install. But I think this is enough to see what apt-metalink offers and its possibility.

License

GPLv3

apt-metalink's People

Contributors

orthographic-pedant avatar piccirello avatar tatsuhiro-t avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.