boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

apt-key DEPRECATION Notice for Debian Based Systems #264

Open fanuch opened 2 years ago

fanuch commented 2 years ago

Note

Debated adding this as a "documentation" change but really I think it might need to be further discussed as I only propose a solution - for which I am not sure if it is best-practice for other users to follow.

Checklist

My Environment

Software Version
Operating System Pop_OS!
Terraform Irrelevant
Terraspace Irrelevant
Ruby Irrelevant

Expected Behaviour

Running apt update on Debian based systems shouldn't throw a deprecation notice

Current Behavior

Step-by-step reproduction instructions

  1. Install terraspace as per the documentation for Ubuntu/Debian
  2. Run apt update
  3. Run into error
  4. Search for solution
  5. Run sudo apt-key export 1FABFF8F | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/boltops.gpg to resolve error

Code Sample

➜ sudo apt update
...                    
Hit:5 https://apt.boltops.com stable InRelease                                
...                                   
Get:16 http://apt.pop-os.org/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [12.5 kB]                                              
Fetched 602 kB in 6s (92.8 kB/s)                                                                                                          
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
29 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: https://apt.boltops.com/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Solution Suggestion

I am far from an authority on this but I found this solution:

curl https://yourrepo.com/repo.key | gpg --dearmor | sudo dd of=/usr/local/share/keyrings/your-repo.gpg

Which would mean the new documentation would be:

sudo su
echo "deb https://apt.boltops.com stable main" > /etc/apt/sources.list.d/boltops.list
curl -s https://apt.boltops.com/boltops-key.public | gpg --dearmor | sudo dd of=/usr/local/share/keyrings/boltops.gpg

Note: I don't have a /usr/local/share/keyrings directory on my system. Not sure of the best place to put it if not /etc/apt/trusted.gpg.d/ :shrug: