← All Modules

assay.apt (Lua stdlib — apt-repo index reader)

Note: This documents require("assay.apt") — the Lua stdlib for reading apt-style Packages indices over HTTP. For the apt.* builtin global (apt-get/dpkg-query wrapper introduced in v0.15.5), see apt.md.

Debian/Ubuntu apt package index reader. Fetches a Packages index from any apt-style HTTP repository, transparently decompressing .gz / .xz / .zst variants, parses the RFC 822-style stanzas, and exposes a per-package view with versions sorted newest-first using Debian version comparison.

Functions

The module tries Packages.gz, Packages.xz, Packages.zst, then plain Packages in that order until one returns 200.

Index methods

Package fields

Example

local apt = require("assay.apt")

local idx = apt.packages({
  base_url  = "https://pkgs.tailscale.com/stable/ubuntu",
  dist      = "noble",
  component = "main",
  arch      = "amd64",
})

local pkg = idx:find("tailscale")
print(pkg.version)        -- e.g. "1.84.3"
print(pkg.versions[1])    -- newest