Apt-key deprecated: adding and signing 3rd party repos in PureOS Byzantium

the latest update to Byzantium does not allow me to use apt-key to add a key for a 3rd party repo source, instead requiring to manually create a pgp file. I found the following solution found in this article to work. I needed to install the Atom.io editor,

first I downloaded the key, convert it to binary and store it in the folder /usr/local/share/keyring which I had to create, in the file <repo-name>-archive-keyring.gpg

wget -O- https://packagecloud.io/AtomEditor/atom/gpgkey | gpg --dearmor | sudo tee /usr/local/share/keyrings/atom-archive-keyring.gpg

Initially I tried donwloading the key without converting it (gpg -dearmor), but apt complained it could not find any public key.

Next I created a new source list file, /etc/apt/sources.list.d/<repo-name>.list

echo ‘deb [arch=amd64 signed-by=/usr/local/share/keyrings/atom-archive-keyring.gpg] https://packagecloud.io/AtomEditor/atom/any/ any main’ | sudo tee /etc/apt/sources.list.d/atom.list`

note the configuration attribute [signed-by=...] pointing to the pgp file created in the previous step.

I hope this helps some other linux-noob like myself!

2 Likes

Am posting an update with a simpler solution,

you can simply place the GnuPG key in the trusted.gpg.d folder,

wget -O- https://packagecloud.io/AtomEditor/atom/gpgkey | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/atom-archive-keyring.gpg >> /dev/null

and the source in the sources.list.d no longer requires a signed-by attribute,

echo ‘deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main’ | sudo tee /etc/apt/sources.list.d/atom.list`
1 Like