Resolves KaKi87/dynapt#1: consolidate the tutorial gist into the repository root and document the project accurately against the current implementation: - Describe dynapt's purpose and its relationship to deb-get/AM (it fronts APT, it is not a package manager). - Document installation (prebuilt DEBs to /opt/dynapt), configuration schema (port/concurrency/apps/githubAccessToken, app url/github/appimage/jq/id), APT source and startup/autostart setup. - Reference every CLI command from main.js (serve, list, update, clean, version). - Explain the pipelines (Fetch -> download wrap -> dpkg-scanpackages -> apt-ftparchive Release). - Fold in the tested FOSS/proprietary app examples, troubleshooting, build/run and project layout sections. Only the placeholder README.md (40 bytes) is replaced; no code changed. |
||
|---|---|---|
| lib | ||
| src | ||
| .gitignore | ||
| build.sh | ||
| dirname.js | ||
| dynapt | ||
| main.js | ||
| permissions.sh | ||
| README.md | ||
dynapt
Dynamic APT repository.
If you're frustrated that an app you use doesn't ship automated updates via an APT repository, a PPA or Flatpak, the classic solution is a file server hosting DEB files that the APT package manager can consume.
dynapt does exactly that, but on your local machine: it downloads DEB files
(and can wrap AppImages into DEBs), turns them into a valid local APT
repository, and serves it over HTTP so that ordinary apt commands work as if
the app shipped its own repository.
Not a package manager. dynapt interfaces with APT instead. You keep using your usual tools —
apt,aptitude, Synaptic or your desktop environment's app store. Compare with deb-get (a package manager for DEB files) and AM (a package manager for AppImage files).
Features
- Mirror DEB files from a direct download URL or from GitHub Releases.
- Wrap AppImages into installable DEB packages (with
.desktopfile, icon and optional/usr/binlauncher). - Apply a
jqfilter when a URL returns JSON that points to the real package file. - Cache downloads with ETags/GitHub release IDs so unchanged apps are not reprocessed.
- Serve a standard APT repository (
PackagesandReleaseindices plus thedata/package store) over localhost HTTP. - Optional GitHub access token to avoid GitHub API rate limits.
- Produces per-architecture DEB packages (
amd64andarm64).
Installation
Prebuilt DEBs (as produced by build.sh) are published on the
releases page.
Download and install automatically (replace the architecture if needed):
wget "https://git.kaki87.net/KaKi87/dynapt/releases/download/0.0.0-dev.9b8fa75/dynapt-$(dpkg --print-architecture).deb" \
&& sudo apt install ./dynapt-$(dpkg --print-architecture).deb
Or grab it manually:
dynapt-amd64.deb(x86_64)dynapt-arm64.deb(aarch64)
The package installs to /opt/dynapt and provides the dynapt command in
/usr/bin.
Configuration
Create /opt/dynapt/config.json (when running from source, this is
./config.json next to main.js):
nano /opt/dynapt/config.json
Start from the minimal template:
{
"port": 3000,
"concurrency": null,
"apps": []
}
Top-level options
| Option | Type | Description |
|---|---|---|
port |
integer | Port the repository server listens on. Change it if 3000 is already in use. |
concurrency |
integer or null |
Maximum number of apps downloaded/packaged at the same time. null (default) processes all apps in parallel for faster apt update; set 1 on low-power or low-bandwidth machines. |
apps |
array | List of apps to mirror/wrap, see below. |
githubAccessToken |
string | Optional GitHub personal access token to avoid API rate limits when tracking many GitHub-hosted apps. |
The config is validated on every start with
Joi. App id values are optional: dynapt generates a
UUID (crypto.randomUUID()) and writes it back into the file automatically,
where it is used as the cache key.
App options
Every item in apps supports at least name and exactly one download source
(url or github):
| Field | Type | Description |
|---|---|---|
name |
string | Display name of the app. |
url |
string | HTTPS direct download URL to a DEB or AppImage. |
github |
object | GitHub Release metadata. |
github.repo |
string | Repository in owner/name format (required). |
github.filter |
string | Optional filename filter (picomatch patterns) when multiple DEB/AppImage assets are available (architecture/variant selection). |
github.prerelease |
boolean | When true, follow the latest pre-release instead of the latest stable release. |
appimage |
boolean or object | true (or { "bin": "<command>" }) when the download is an AppImage that must be wrapped into a DEB. bin adds a launcher command in /usr/bin. Omit it to download a DEB directly. |
jq |
string | jq filter applied to a JSON url response to obtain the actual package file URL. Requires url. |
id |
string | Auto-generated UUID cache key — leave this out of hand-written configs. |
Usage
Add dynapt as a local APT repository (adjust the port if you changed it):
echo "deb [trusted=yes] http://127.0.0.1:3000/ /" | sudo tee /etc/apt/sources.list.d/dynapt.list
Start the server (it listens on localhost:<port> and rebuilds the repository
on demand whenever a client requests Packages or Release):
nohup dynapt &
Make it start automatically at boot with cron:
crontab -l | { cat; echo "@reboot dynapt"; } | crontab -
Then use APT as normal: sudo apt update && sudo apt install <app>.
CLI reference
The dynapt command (entry point main.js, run with
Deno) provides:
| Command | Description |
|---|---|
dynapt (no command) or dynapt serve |
Run the APT repository server. |
dynapt list |
Print a table of configured apps, packaged files and their installed/available versions (queries the local apt database). |
dynapt update |
Download and package all configured apps without touching APT — useful to debug fetch problems. |
dynapt clean |
Remove the cached cache.json and downloaded/generated data/ files. |
dynapt version (or -v, -V, --version) |
Print the dynapt version. |
How it works under the hood
On each repository request dynapt reuses a cached update (for 60 seconds) and, for every app:
- Resolves the download — direct
url, a GitHub Release asset list (with optionaljqtransform), honoring ETag/if-none-matchand GitHub release IDs so unchanged apps are skipped. - Downloads the file into
data/<appId>-<index>/. - For AppImages, extracts the embedded
.desktop/icon files, rewrites the desktop entry, and builds a DEB withdpkg-deb. - Indexes the result with
dpkg-scanpackagesinto a.packagestanza and eventually aPackageslist. - Generates the APT
Releasefile withapt-ftparchive.
App configuration examples
FOSS apps
Tested configurations for open-source apps are documented on the related issues/discussions:
- bat
- code-server
- Etcher
- GitHub Desktop
- Helium Browser
- IPFS Desktop
- Jitsi Meet
- Legcord
- LosslessCut
- PDFSam
- scrcpy
- Zen Browser
Proprietary apps
Discord
{
"name": "Discord",
"url": "https://discord.com/api/download?platform=linux&format=deb"
}
Free Download Manager
{
"name": "Free Download Manager",
"url": "https://files2.freedownloadmanager.org/6/latest/freedownloadmanager.deb"
}
kDrive
{
"name": "kDrive",
"url": "https://www.infomaniak.com/drive/latest",
"jq": ".[\"linux-amd64\"].downloadurl",
"appimage": true
}
Replace amd64 with arm64 where applicable.
Kiro
{
"name": "Kiro",
"url": "https://prod.download.desktop.kiro.dev/stable/metadata-linux-x64-deb-stable.json",
"jq": ".releases[].updateTo.url | select(endswith(\".deb\"))"
}
LM Studio
{
"name": "LM Studio",
"url": "https://lmstudio.ai/download/latest/linux/x64",
"appimage": true
}
Troubleshooting
Logs
In addition to the APT command output, check the latest entries in
/opt/dynapt/dynapt.log (next to the executable) for download and packaging
errors.
Clean the cache
Remove previously downloaded and packaged files, then re-download them on the
next apt update:
dynapt clean
Update without APT
Debug download problems without involving APT:
dynapt update
Update APT only for the dynapt repository:
sudo apt update \
-o Dir::Etc::sourcelist="sources.list.d/dynapt.list" \
-o Dir::Etc::sourceparts="-" \
-o APT::Get::List-Cleanup="0"
Inspect packaged versions
dynapt list
Building from source
Requirements:
- Deno
- Debian/Ubuntu tooling and utilities:
bash,coreutils,dpkg,dpkg-dev,dpkg-scanpackages,apt,apt-ftparchive,squashfs-tools(unsquashfs),file(AppImage introspection and DEB packaging).
Build both amd64 and arm64 packages (uses deno compile per target):
./build.sh
The resulting .deb files are written to the build/ directory. The compile
flags and allowed subprocesses/network imports live in
permissions.sh.
Running from a source checkout
./dynapt # run the server (same calls as the installed package)
deno run --no-prompt --allow-sys=hostname \
--allow-env --allow-run --allow-import --allow-read \
--allow-write --allow-net main.js
The dynapt wrapper sources permissions.sh for its
allow-list.
Project layout
| Path | Purpose |
|---|---|
main.js |
CLI entry point (commander): server, list, update, clean, version. |
dirname.js |
Resolves the base directory (executable directory when compiled, source directory otherwise). |
src/getConfig.js |
Reads and Joi-validates config.json, assigns app UUIDs. |
src/server.js |
Fastify server exposing /Packages, /Release and data/. |
src/updatePackages.js |
Download, cache (ETag/ID), AppImage→DEB wrapping, Packages/Release generation. |
src/list.js |
dynapt list table. |
lib/createDebFromAppimage.js |
Extracts an AppImage and builds a Debian package. |
lib/extractAppimage.js |
Locates and extracts bundled .desktop/icons via unsquashfs. |
lib/getBinArchitecture.js |
Falls back to file to derive architecture. |
lib/buildDeb.js |
Shells out to dpkg-deb --build. |
lib/loxer.js |
Logging setup. |
Status and roadmap
dynapt is experimental. Once it reaches a stable release it will provide its own APT self-updates and an optional step-by-step wizard instead of this manual setup/procedure; a stable CLI/GUI is also planned. Until then it must be updated manually. Subscribe to the tutorial gist or watch this repository for release notifications.
Questions, bug reports and feature requests are welcome as repository issues.
Thank you for using dynapt. ❤️