Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kstr0k/migrate-apt-keys

Migrates from "apt-key" managed keys to "[signed-by=.../keyrings/...]"
https://github.com/kstr0k/migrate-apt-keys

apt apt-key debian gpg security shell-script ubuntu

Last synced: 3 months ago
JSON representation

Migrates from "apt-key" managed keys to "[signed-by=.../keyrings/...]"

Awesome Lists containing this project

README

        

# `migrate-apt-keys`

## _Add signing info to `sources.list.d` Debian `apt` repos_

This script looks at each `deb[-src]` entry in the specified (or default) `SOURCE.list` files and
- adds `[signed-by]` qualifiers if missing
- downloads the corresponding `gpg` key into a designated folder

## Background

In recent (~2022) Ubuntu / Debian's, `/etc/apt/sources.list.d/` repos signed by system-wide keys from `/etc/apt/trusted.gpg` trigger an `apt update` warning. Meanwhile, repos signed by individual `/etc/apt/trusted.gpg.d/*` keys don't; yet this is mostly security theatre, because the `trusted.gpg.d/*` keys still apply to all "unsigned" repos.

This script adds a `[signed-by]` qualifier to each `deb[-src] ...` entry within each `SOURCE.list` repo, and downloads all relevant keys into `/usr/local/share/keyrings/SOURCE-apt-keyring.gpg` (or a specified folder).

## Usage

```sh
migrate-apt-keys --help
migrate-apt-keys [ KEYRING_FOLDER [SOURCE.list]... ]
```

## Copyright

[MIT license](LICENSE.txt): [`Jens Berthold `](https://github.com/maxhq), [`Alin Mr. `](https://github.com/mralusw)