# [`distro-url`][]
Print [Linux][] [distro][] info, including [image][] [URL][]s.
Note that the latest versions are hard coded, which means they will need to be
manually updated, which means they may be out of date.
[`distro-url`]: https://git.rcrnstn.net/rcrnstn/distro-url
[Linux]: https://en.wikipedia.org/wiki/Linux
[distro]: https://en.wikipedia.org/wiki/Linux_distribution
[image]: https://en.wikipedia.org/wiki/Optical_disc_image
[URL]: https://en.wikipedia.org/wiki/URL
## Usage
```
distro-url [query] [guess] [<distro> [<variant> [<arch> [<codename> [<version> [<mirror>]]]]]]
```
- `query`: Optional verbatim string, turning on query mode which will query
the [mirror][]s for each [URL][] to check that they are valid.
- `guess`: Optional verbatim string, switching from the default filter mode
to guess mode. Filter mode interprets the rest of the parameters as
[glob][]s (defaulting to `*`, matching everything) to filter an internal
list of known good parameter combinations. Guess mode interprets the rest
of the parameters as fixed strings (defaulting to sensible values for the
given `<distro>`) and will do its best to construct a [URL][] out of them.
- `<distro>`: The [distro][] to print the [URL][] for.
- `<variant>`, `<arch>`, `<codename>`, `<version>`: Optional parameters to
select a different [image][] than the default.
- `<mirror>`: Optional override of the default [mirror][].
[glob]: https://en.wikipedia.org/wiki/Glob_(programming)
[mirror]: https://en.wikipedia.org/wiki/Mirror_site
## Dependencies
- [POSIX][] [shell][].
- `column`, optional, for formatting.
- `curl`, optional, for query mode.
- `tput`, optional, for color.
[POSIX]: https://en.wikipedia.org/wiki/POSIX
[shell]: https://en.wikipedia.org/wiki/Unix_shell
## Examples
```sh
$ distro-url debian netinst
DISTRO VARIANT ARCH CODENAME VERSION URL
debian netinst amd64 trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/amd64/iso-cd/debian-13.5.0-amd64-netinst.iso
debian netinst arm64 trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/arm64/iso-cd/debian-13.5.0-arm64-netinst.iso
debian netinst armhf trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/armhf/iso-cd/debian-13.5.0-armhf-netinst.iso
debian netinst ppc64el trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/ppc64el/iso-cd/debian-13.5.0-ppc64el-netinst.iso
debian netinst riscv64 trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/riscv64/iso-cd/debian-13.5.0-riscv64-netinst.iso
debian netinst s390x trixie 13.5.0 https://cdimage.debian.org/debian-cd/13.5.0/s390x/iso-cd/debian-13.5.0-s390x-netinst.iso
$ distro-url '*' '*raspi*'
DISTRO VARIANT ARCH CODENAME VERSION URL
debian raspi arm64 trixie 13.5.0 https://cloud.debian.org/images/cloud/trixie/daily/latest/debian-13-raspi-arm64-daily.tar.xz
ubuntu desktop-raspi arm64 resolute 26.04 https://cdimage.ubuntu.com/ubuntu/releases/resolute/release/ubuntu-26.04-preinstalled-desktop-arm64+raspi.img.xz
ubuntu server-raspi arm64 resolute 26.04 https://cdimage.ubuntu.com/ubuntu/releases/resolute/release/ubuntu-26.04-preinstalled-server-arm64+raspi.img.xz
edubuntu desktop-raspi arm64 resolute 26.04 https://cdimage.ubuntu.com/edubuntu/releases/resolute/release/edubuntu-26.04-preinstalled-desktop-arm64+raspi.img.xz
$ distro-url query guess debian inst arm64 unknown 99.0.0
DISTRO VARIANT ARCH CODENAME VERSION URL QUERY
debian inst arm64 unknown 99.0.0 https://cdimage.debian.org/debian-cd/99.0.0/arm64/iso-dvd/debian-99.0.0-arm64-DVD-1.iso ERR
```
## Related projects
- [`dl-distro`](https://codeberg.org/bashuser30/dl-distro): Bash script for
downloading and verifying OS images. Supports ~700 images from ~40 Linux
distros. Lacks some Raspberry Pi images.
- [`data.json`](https://codeberg.org/bashuser30/dl-distro/src/branch/master/data.json)
- [`distro-info`](https://packages.debian.org/distro-info): Information about
releases of Debian and Ubuntu. Lacks support for other distros and distro
URLs.
- [`debian.csv`](https://debian.pages.debian.net/distro-info-data/debian.csv)
- [`ubuntu.csv`](https://debian.pages.debian.net/distro-info-data/ubuntu.csv)
- [`libosinfo`](https://libosinfo.org): Command line tools and APIs to query
a database of metadata about operating systems among other things. It has
way more coverage, including non-Linux operating systems, but does not
include image URLs. Part of the [Virt Tools](https://www.virt-tools.org)
family, so mostly focused on distro variants suitable for virtualization.
## License
Licensed under the [ISC License][] unless otherwise noted, see the
[`LICENSE`][] file.
[ISC License]: https://choosealicense.com/licenses/isc
[`LICENSE`]: LICENSE