Files

73 lines
3.1 KiB
Markdown

# deb metadata
Bootstrap script and shared documentation for the `deb` organization's APT repository on [BJPHoster Gitea](https://git.bjphoster.com/deb).
## Quick setup
Run this one-liner on a Debian-based machine with Bash, curl and CA certificates installed:
```bash
curl -fsSL https://git.bjphoster.com/deb/.meta/raw/branch/main/setup.sh | bash
```
The script runs privileged commands directly when the effective UID is `0`. Otherwise it uses `sudo`, which may prompt for your password. If `sudo` is unavailable, it exits with status `1` and prints `manca sudo ed รจ necessario` to standard error. Your account must be allowed to run the installation commands and `apt update` through sudo.
The script checks for `apt`, `curl`, `install` and `mktemp`, then:
1. Downloads the registry's public signing key over HTTPS into a temporary directory.
2. Creates `/etc/apt/keyrings` and `/etc/apt/sources.list.d` if needed.
3. Installs the key as `/etc/apt/keyrings/bjphoster-deb.asc` with mode `0644`.
4. Writes `/etc/apt/sources.list.d/bjphoster-deb.list` with mode `0644`.
5. Runs `apt update` to refresh package indexes.
Temporary files are removed on exit. A failed command stops setup with a nonzero status. Files already installed remain in place if a later step fails. Running the script again replaces the same two files without appending duplicate entries. If you previously added this repository to a different source file, remove that duplicate entry yourself.
To inspect the script before running it:
```bash
curl -fsSL https://git.bjphoster.com/deb/.meta/raw/branch/main/setup.sh -o setup.sh
less setup.sh
bash setup.sh
```
## Repository configuration
The source entry is:
```text
deb [signed-by=/etc/apt/keyrings/bjphoster-deb.asc] https://git.bjphoster.com/api/packages/deb/debian stable main
```
`stable` is the registry's distribution name and `main` is its component. Use these values on supported Debian-based systems, regardless of the host's release codename. Each package still has its own architecture and operating system dependency requirements; adding the repository does not guarantee every package supports your machine.
The key is downloaded from:
```text
https://git.bjphoster.com/api/packages/deb/debian/repository.key
```
`signed-by` limits this key to this source entry. Gitea generates the package indexes and signed release metadata from packages published to the organization's Debian registry. Git repositories and release attachments alone do not publish packages to APT. See the [Gitea Debian registry documentation](https://docs.gitea.com/usage/packages/debian/).
## Install packages
After setup, install a published package normally, for example:
```bash
sudo apt install skeptical-updater
```
When already running as root, omit `sudo`. Setup itself only configures the repository and refreshes indexes; it does not install or upgrade packages.
## Remove the repository
```bash
sudo rm -f /etc/apt/sources.list.d/bjphoster-deb.list /etc/apt/keyrings/bjphoster-deb.asc
sudo apt update
```
When already running as root, omit `sudo`. Removing the source leaves installed packages in place.
## License
MIT, see [LICENSE](LICENSE).