This script helps you find the fastest mirror for your Ubuntu and it's derivatives and generates a sources.list file accordingly.
It downloads the Release file from each mirror to measure the speed and identifies the fastest one.
- Python 3.6 or higher
requestslibrary
-
Recommended - Using PIP
pip install mircheck
-
Clone the repository:
git clone https://github.com/arkrwn/mircheck.git cd mircheck/mircheck pip install -r ../requirements.txt chmod +x main.py
Install using pip: `mircheck [options] <distribution> <country>`
Install using git: `./mircheck [options] <distribution> <country>`distribution: Distribution code name (e.g., jammy, bionic).country: Country code or name.
-a, --arch ARCH: Specify architecture (e.g., amd64, arm64). Default is the architecture of the current machine.-s, --sources: Includedeb-srclines in the generatedsources.list.-o, --outfile OUTFILE: Output file forsources.list. Default is./sources.list.-n, --nonfree: Include non-free section in the generatedsources.list.-d, --distribution_type {stable, testing, unstable, experimental, release_codename, sid}: Specify which distribution of Debian to use. Default isstable.
-
Find the fastest mirror for Ubuntu
jammyin Indonesia and save to the current directory:mircheck jammy id
-
Find the fastest mirror for Debian
stablein Germany and include source lines:mircheck stable germany -s
-
Find the fastest mirror for Ubuntu
bionicin the USA and save to a custom path:mircheck bionic us -o /path/to/custom/sources.list
The script will test each mirror's speed and display the results in kilobytes per second (KB/s). It will identify the fastest mirror and generate a sources.list file with the appropriate entries.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to submit issues and pull requests. For major changes, please open an issue first to discuss what you would like to change.
- The Ubuntu for providing mirror lists.