google-coral / edgetpu

Coral issue tracker (and legacy Edge TPU API source)
https://coral.ai
Apache License 2.0
412 stars 124 forks source link

M.2 install instructions use deprecated apt-key add #777

Open rovingclimber opened 11 months ago

rovingclimber commented 11 months ago

Description

Hi!

In your instructions for installing the M.2 / Mini PCIe coral, you use apt-key add:

echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update

If you follow these instructions on a modern version of debian / ubuntu you'll get a warning that apt-key is deprecated. It's hard to find simple instructions on how to add the key the correct way, but after a work I've come up with the below which works with no errors:

wget -qO - https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/google.gpg --import -
sudo rm /etc/apt/trusted.gpg.d/google.gpg~
sudo chmod 644 /etc/apt/trusted.gpg.d/google.gpg
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
sudo apt-get update

For some reason gpg creates a temp (~ suffix) file when working, hence deleting that, and also leaves the file accessible only to root, hence the CHMOD which allows the apt user to read.

There may be a better way to do this but suggest updating your documentation with either the above or, if you can find it, a cleaner way to add to the keyring that's up-to-date with current OS.

Click to expand! ### Issue Type Documentation Bug ### Operating System Linux ### Coral Device Mini PCIe, M.2 Accelerator A+E, M.2 Accelerator B+M, M.2 Accelerator with dual Edge TPU ### Other Devices _No response_ ### Programming Language _No response_ ### Relevant Log Output _No response_
shopboy3 commented 10 months ago

Thank you for this, I've been looking for a solution to the apt-key being depreciated with no luck. This worked for OpenMedianVault running on Debian 12, HP Proliant machine with pcie Coral installed

GregHilston commented 8 months ago

TY!

glichou commented 8 months ago

Hello

I got the same warning message when following the coral installation documentation. If it can helps, I used the following commands with success (inspired from https://itsfoss.com/apt-key-deprecated/) :

curl -sS https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/google.gpg
echo "deb [signed-by=/usr/share/keyrings/google.gpg] https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
sudo apt-get update
nebkas commented 6 months ago

Awesome, thank you!