Git Product home page Git Product logo

apt-select's Introduction

apt-select

Find a fast, up-to-date Ubuntu Archive Mirror.

Features

  • Tests latency to mirrors in mirrors.txt.
    • 3 requests are sent to each mirror, minumum round trip time being used for rank.
  • Reports latency, status, and bandwidth capacity of the fastest mirrors in a ranked list.
    • Status and bandwidth are scraped from launchpad.
  • Generates sources.list file using new mirror.
    • New mirror can be chosen from a list or selected automatically using the top ranked mirror (default).

Installation

Target most recent release:

pip install apt-select

or:

pip3 install apt-select

or:

easy_install apt-select

Target project master branch:

pip install git+https://github.com/jblakeman/apt-select.git

or:

git clone https://github.com/jblakeman/apt-select
python apt-select/setup.py install

Invocation

$ apt-select --help
usage: apt-select [-h] [-t NUMBER] [-m STATUS | -p] [-c | -l]

Find the fastest Ubuntu apt mirrors.
Generate new sources.list file.

optional arguments:
  -h, --help            show this help message and exit
  -t NUMBER, --top-number NUMBER
                        specify number of mirrors to return
                        default: 1
  -m STATUS, --min-status STATUS
                        return mirrors with minimum status
                        choices:
                           up-to-date
                           one-day-behind
                           two-days-behind
                           one-week-behind
                           unknown
                        default: up-to-date
  -p, --ping-only       rank mirror(s) by latency only, disregard status(es)
                        cannot be used with -m/--min-status
  -c, --choose          choose mirror from a list
                        requires -t/--top-num NUMBER where NUMBER > 1
  -l, --list            print list of mirrors only, don't generate file
                    cannot be used with -c/--choose

Examples

Choose from the top 3 mirrors, including those last updated a week ago::

apt-select -c -t 3 -m one-week-behind

Find the top 10 mirrors, output latency info only, and don't generate new config file::

apt-select -t 10 -p -l

After new sources.list is generated in current working directory, backup and replace to update apt::

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
sudo mv sources.list /etc/apt/

Supported URI Types

Currently, http and ftp are supported.

/etc/apt/sources.list should contain sources in the following format::

[deb|deb-src] [http|ftp]://mirror.example.com/path [component1] [component2] [...]

Dependencies

Python HTML parser, BeautifulSoup.

apt-select's People

Contributors

jblakeman avatar

Watchers

David Kartik avatar James Cloos 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.