apt-mirror Python reimplementation
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apt-mirror-2.tar.gz.
File metadata
- Download URL: apt-mirror-2.tar.gz
- Upload date:
- Size: 61.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03e57f22584db4cd2d99dceee90b2ae4a9a3b383dd1d4de67e9560c14ad1713d
|
|
| MD5 |
df856b42c684bfb3d839b0a440115c76
|
|
| BLAKE2b-256 |
bcdb097834ee883e51ba99aca2235ab6bf184220e51dad6ac57b7af04298608e
|
File details
Details for the file apt_mirror-2-py3-none-any.whl.
File metadata
- Download URL: apt_mirror-2-py3-none-any.whl
- Upload date:
- Size: 48.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
837eaa27a39c2a38c29204ce14b4d1db08c96ca9febe822f65a07bc8dc51b6fb
|
|
| MD5 |
5a1b8ec74169b914475f1c1d592c474c
|
|
| BLAKE2b-256 |
b4b24d1e96a94146da9709e4f34873207c77c5919b5c7cafcc200873ce9cb7b2
|