apt-mirror2
apt-mirror2 is the Python/asyncio reimplementation of the
apt-mirror developed as drop-in replacement for the latest.
This project should be suitable as general apt-mirror replacement.
Requirements
Python 3.10 is the minimum supported version.
For additional dependencies look to the pyproject.yml and/or requirements.txt.
Installation
Docker
Docker image is available in the Docker Hub under aptmirror/apt-mirror2 repository. You can try it using
docker run -it --rm aptmirror/apt-mirror2 --help
PyPi
PyPi package is available with the name apt-mirror:
pip install apt-mirror
apt-mirror --help
Build from source with virtualenv
It's possible to use apt-mirror2 from a virtualenv:
# Let's work in the home folder
cd
# Create virtualenv
virtualenv ~/venv/apt-mirror2
source ~/venv/apt-mirror2/bin/activate
# Clone apt-mirror2 source code
git clone https://gitlab.com/apt-mirror2/apt-mirror2
cd apt-mirror2
# Install requirements
pip install -r requirements.txt
# Install apt-mirror2 into virtualenv
python setup.py install
apt-mirror --help
Usage
As the drop-in replacement for the apt-mirror this project supports same CLI syntax.
usage: apt-mirror [-h] [--version] [configfile]
positional arguments:
configfile Path to config file. Default /etc/apt/mirror.list
options:
-h, --help show this help message and exit
--version Show version
apt-mirror configuration compatibility
Most of apt-mirror configuration directives are supported.
As of now proxy for FTP repositories is not supported.
In addition there are some enhancements available:
- Repositories without MD5 hashsums are correctly mirrored
- Old index files are properly cleaned and don't produces errors in mirror processing
- Standard source.list
[ arch=arch1,arch2 ]can be used to specify multiple repository architectures for mirroring. mirror_path URL PATHoption may be used to specifyPATHto use for saving mirror files instead of path that is generated fromURL.- Additional configuration is loaded from the
*.listfiles in the directory named same asconfigfilewith the.dsuffix. Eg/etc/apt/mirror.list.d/*.list. - Rate limit is enforced for overall download rate.
- Non-zero exit code is returned if some of required files were not downloaded due to network or server errors or no repositories were configured.
- HTTP user agent can be configured via
user_agentconfiguration. - Configuration variables are exposed to postmirror_script.
by-hashlist option can be used to control whetherAcquire-By-HashRelease option should be respected or enforced.
License
GNU General Public License v3.0 or later
Metadata
Release files for apt-mirror 3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apt-mirror-3.tar.gz | 63.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apt_mirror-3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 113.2 kB
Release files / apt-mirror-3.tar.gz
| Download URL | apt-mirror-3.tar.gz |
|---|---|
| Size | 63.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcaadfba3468460149dbd32426bad8e4f109e47a9aad478ab533b2ffef084eb2
|
|
BLAKE2b-256 checksum How to use checksums |
226afd4b229ec64f08265100d521f4cd00fe9d6748836b035fe066d427537016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|
Release files / apt_mirror-3-py3-none-any.whl
| Download URL | apt_mirror-3-py3-none-any.whl |
|---|---|
| Size | 50.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6907977192fe3ef5a58b1adceb28084cfc0b94ee156a8359ae206959a810c58
|
|
BLAKE2b-256 checksum How to use checksums |
54bc46117f3897ba5aeb2bf5086ef89b8f1533635265d93c25e3eece9f16f683
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|