Offline package downloader - support Debian/apt and RPM/dnf, resolve deps, download packages, generate offline install script
Project description
pkgeter v1.3.4
English | 中文
Offline package downloader — supports Debian/apt and RPM/dnf (CentOS, Kylin, RockyLinux, etc.). Resolve dependency trees, download .deb or .rpm files, generate offline install script, or produce a local apt/yum mirror.
Works on any platform (Linux, Windows, macOS) — useful when you need to install packages on an air-gapped or offline machine.
Features
v1.3.4: fixes Debian multiarch dependency resolution such as
python3:any, resolving failures likeopenvswitch-switchonpve-8.
- Dual backend — supports Debian (
dpkg) and RPM (rpm/dnf/yum) based distributions - Distribution presets — 14+ ready-to-use presets:
--distro debian-bookworm,--distro centos-7,--distro ubuntu-noble - Interactive REPL — run
pkgeterwith no arguments to enter a switch-style CLI with prefix matching and TAB completion - Multi-repo merge — automatically combines repositories (e.g., main + security, BaseOS + AppStream + EPEL)
- Dependency resolution — recursively resolves all dependencies for the target packages
- Virtual package resolution — follows
Providesfields for virtual dependencies with interactive provider selection - Skip installed packages — optionally provide a
dpkg -l/rpm -qaoutput to skip already-installed packages - SHA256 verification — validates every downloaded
.debor.rpmfile - Source caching — caches repository metadata with SHA256 validation (SQLite-backed), only re-downloads when changed
- Local mirror output —
--repoflag generates a fully structured apt repo (Packages.gz+Release) or yum repo (repomd.xml+ metadata) - Dependency tree visualization —
--treeflag generates an interactive HTML dependency tree - Offline install script — auto-generates
install.shthat runsdpkg -iorrpm -ivhin dependency order (auto-detects sudo) - Multiple mirrors — specify fallback mirrors, tried in order until one succeeds
- Persistent config — preferences saved to
~/.config/pkgeter/config.yaml - Repo management — add, list, and remove custom repositories via
pkgeter repo
Installation
From PyPI (recommended)
pip install pkgeter
From source
git clone https://github.com/mlzxgzy/pkgeter.git
cd pkgeter
pip install -e .
Usage
# Interactive REPL (no arguments)
pkgeter
# Download packages using a distribution preset
pkgeter get -p nginx --distro debian-bookworm
pkgeter get -p nginx --distro centos-9
pkgeter get -p nginx --distro ubuntu-noble
# Short prefix forms work too
pkgeter g -p nginx --distro centos-9
# Generate local apt/yum mirror metadata (instead of flat output)
pkgeter get -p nginx --distro debian-bookworm --repo
# Generate dependency tree HTML report
pkgeter get -p nginx --distro debian-bookworm --tree
# Legacy usage (backward compatible)
pkgeter get -p vim
pkgeter get -p nginx -r bookworm -a amd64
# Specify multiple mirrors (tried in order)
pkgeter get -p nginx -m https://deb.debian.org/debian -m https://ftp.debian.org/debian
# Manage repositories
pkgeter repo list
pkgeter repo add --name myrepo --type deb --url https://example.com/debian --release bookworm
pkgeter repo remove myrepo
# List and apply distribution presets
pkgeter preset list
pkgeter preset apply centos-9
# Specify a custom output directory
pkgeter get -p python3 -o ./my-output
Output Formats
Two output modes, controlled by the --repo flag:
| Mode | Flag | Structure | Use Case |
|---|---|---|---|
| Flat (default) | (none) | debs/*.deb + install.sh or rpms/*.rpm + install.sh |
Quick copy + install |
| Mirror | --repo |
pool/, dists/, Packages.gz, Release (deb) or Packages/, repomd.xml (rpm) |
Add as permanent apt/yum source |
For Debian mode, all .deb files are placed in a debs/ subdirectory. For RPM mode, all .rpm files are placed in a rpms/ subdirectory. An install.sh script is generated that runs dpkg -i or rpm -ivh in dependency order.
# Debian: copy the debs/ directory and install.sh to the target machine, then:
sudo bash install.sh
# RPM: copy the rpms/ directory and install.sh to the target machine, then:
sudo bash install.sh
Configuration
pkgeter stores persistent preferences at ~/.config/pkgeter/config.yaml. This file is automatically created when you run the tool.
backend: debian
arch: amd64
repos:
- name: debian-main
type: deb
url: https://deb.debian.org/debian
release: bookworm
- name: debian-security
type: deb
url: https://security.debian.org/debian-security
release: bookworm-security
CLI flags override config file values. Apply a preset to quickly populate the config:
pkgeter preset apply centos-9
To add or override repositories in a built-in preset, create ~/.config/pkgeter/custom-presets.yaml. This file is optional and merged onto built-in presets by preset name, repo name, and mirror name.
pve-8:
repos:
- name: ceph-squid
type: deb
url: https://download.proxmox.com/debian/ceph-squid
release: bookworm
components: [no-subscription]
mirrors:
- name: cn
provider: ustc
urls:
ceph-squid: https://mirrors.ustc.edu.cn/proxmox/debian/ceph-squid
After editing custom-presets.yaml, re-run pkgeter preset apply <preset> to persist the merged repo list into config.yaml.
How It Works
- Download package database — fetches metadata from configured repositories (Packages.gz for Debian, repomd.xml + primary.xml.gz for RPM)
- Parse dependency tree — recursively resolves all required packages (handles AND/OR deps, virtual packages, cycle detection)
- Download package files — downloads each package with SHA256 verification
- Generate output — creates
debs/orrpms/directory withinstall.sh, or full mirror structure when--repois used
Distribution Presets
| Preset | Backend | Included Repositories |
|---|---|---|
debian-bookworm |
apt (deb) | main, security, updates |
debian-bullseye |
apt (deb) | main, security, updates |
debian-trixie |
apt (deb) | main, security, updates |
debian-buster |
apt (deb) | main, security, updates |
debian-stretch |
apt (deb) | main, security, updates |
ubuntu-noble (24.04) |
apt (deb) | main, universe, security, updates |
ubuntu-jammy (22.04) |
apt (deb) | main, universe, security, updates |
ubuntu-focal (20.04) |
apt (deb) | main, universe, security, updates |
ubuntu-bionic (18.04) |
apt (deb) | main, universe, security, updates |
centos-9 |
rpm | BaseOS, AppStream, EPEL |
centos-7 |
rpm | base, extras, updates, EPEL |
pve-8 |
apt (deb) | bookworm main, security, updates + pve-no-subscription + ceph-squid |
kylin-V10 |
rpm | base, updates |
License
MIT
Project details
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 pkgeter-1.3.4.tar.gz.
File metadata
- Download URL: pkgeter-1.3.4.tar.gz
- Upload date:
- Size: 162.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
240bcb74f17a12c25c0a572365465c8839f1e8e9678553c54e4a06ac39b4ece9
|
|
| MD5 |
aec8e3deb2329af9ffb3bc1ccd29256a
|
|
| BLAKE2b-256 |
f666518ab88161950a44d3901d6f18ac37bccc243b06c61fe84227c9d052cb41
|
Provenance
The following attestation bundles were made for pkgeter-1.3.4.tar.gz:
Publisher:
python-publish.yml on mlzxgzy/pkgeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pkgeter-1.3.4.tar.gz -
Subject digest:
240bcb74f17a12c25c0a572365465c8839f1e8e9678553c54e4a06ac39b4ece9 - Sigstore transparency entry: 2124872870
- Sigstore integration time:
-
Permalink:
mlzxgzy/pkgeter@78b77c400e033b37631386b17b2b27df1c03afd8 -
Branch / Tag:
refs/tags/v1.3.4 - Owner: https://github.com/mlzxgzy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@78b77c400e033b37631386b17b2b27df1c03afd8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pkgeter-1.3.4-py3-none-any.whl.
File metadata
- Download URL: pkgeter-1.3.4-py3-none-any.whl
- Upload date:
- Size: 161.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
720448350cd01d708dd5f40c6cc85d273700d29d13770f00a9c96a06f4a5462f
|
|
| MD5 |
9c8b5b87964305152bfa293ecf7336ac
|
|
| BLAKE2b-256 |
aad9902823282488129b1921511ef5111b7b81e571ee523d8da27549ee7ab55b
|
Provenance
The following attestation bundles were made for pkgeter-1.3.4-py3-none-any.whl:
Publisher:
python-publish.yml on mlzxgzy/pkgeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pkgeter-1.3.4-py3-none-any.whl -
Subject digest:
720448350cd01d708dd5f40c6cc85d273700d29d13770f00a9c96a06f4a5462f - Sigstore transparency entry: 2124872896
- Sigstore integration time:
-
Permalink:
mlzxgzy/pkgeter@78b77c400e033b37631386b17b2b27df1c03afd8 -
Branch / Tag:
refs/tags/v1.3.4 - Owner: https://github.com/mlzxgzy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@78b77c400e033b37631386b17b2b27df1c03afd8 -
Trigger Event:
release
-
Statement type: