ROS melodicインストール時のキーエラー (NO_PUBKEY F42ED6FBAB17C654)

Jetson NanoにROSをインストールしようとして、このページ

を参照しながら進めたところ、sudo apt updateの際にROS関連パッケージ情報を取得する部分でエラーが出てしまった。

$ sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

(割愛)
$ sudo apt update
Get:1 file:/var/cuda-repo-10-0-local-10.0.166 InRelease
Ign:1 file:/var/cuda-repo-10-0-local-10.0.166 InRelease
Get:2 file:/var/visionworks-repo InRelease
Ign:2 file:/var/visionworks-repo InRelease
Get:3 file:/var/visionworks-sfm-repo InRelease
Ign:3 file:/var/visionworks-sfm-repo InRelease
Get:4 file:/var/visionworks-tracking-repo InRelease
Ign:4 file:/var/visionworks-tracking-repo InRelease
Get:5 file:/var/cuda-repo-10-0-local-10.0.166 Release [574 B]
Get:6 file:/var/visionworks-repo Release [1,999 B]
Get:7 file:/var/visionworks-sfm-repo Release [2,003 B]
Get:8 file:/var/visionworks-tracking-repo Release [2,008 B]
Get:5 file:/var/cuda-repo-10-0-local-10.0.166 Release [574 B]
Get:6 file:/var/visionworks-repo Release [1,999 B]
Get:7 file:/var/visionworks-sfm-repo Release [2,003 B]
Get:8 file:/var/visionworks-tracking-repo Release [2,008 B]
Hit:13 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Hit:15 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Get:12 http://packages.ros.org/ros/ubuntu bionic InRelease [4,669 B]
Hit:16 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Err:12 http://packages.ros.org/ros/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
Hit:17 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
Hit:18 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Reading package lists...
W: GPG error: http://packages.ros.org/ros/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository 'http://packages.ros.org/ros/ubuntu bionic InRelease' is not signed.

どうやらターゲットとなっている公開鍵が取得不能で認証が失敗しているらしいため、一旦keyを削除する。

$ sudo apt-key del F42ED6FBAB17C654

OK

再びkeyをセットしてsudo apt updateすると

$ sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

(割愛)
$ sudo apt -q update
Get:1 file:/var/cuda-repo-10-0-local-10.0.166 InRelease
Ign:1 file:/var/cuda-repo-10-0-local-10.0.166 InRelease
Get:2 file:/var/visionworks-repo InRelease
Ign:2 file:/var/visionworks-repo InRelease
Get:3 file:/var/visionworks-sfm-repo InRelease
Ign:3 file:/var/visionworks-sfm-repo InRelease
Get:4 file:/var/visionworks-tracking-repo InRelease
Ign:4 file:/var/visionworks-tracking-repo InRelease
Get:5 file:/var/cuda-repo-10-0-local-10.0.166 Release [574 B]
Get:6 file:/var/visionworks-repo Release [1,999 B]
Get:7 file:/var/visionworks-sfm-repo Release [2,003 B]
Get:8 file:/var/visionworks-tracking-repo Release [2,008 B]
Get:5 file:/var/cuda-repo-10-0-local-10.0.166 Release [574 B]
Get:6 file:/var/visionworks-repo Release [1,999 B]
Get:7 file:/var/visionworks-sfm-repo Release [2,003 B]
Get:8 file:/var/visionworks-tracking-repo Release [2,008 B]
Hit:12 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Hit:14 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Hit:15 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Hit:16 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
Hit:17 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Get:18 http://packages.ros.org/ros/ubuntu bionic InRelease [4,669 B]
Get:19 http://packages.ros.org/ros/ubuntu bionic/main arm64 Packages [482 kB]
Get:19 http://packages.ros.org/ros/ubuntu bionic/main arm64 Packages [482 kB]
Fetched 482 kB in 1min 8s (7,109 B/s)
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.

今度はうまくいった。この後問題なくsudo apt install ros-melodic-desktop-fullも進んだ。

一時的な問題かもしれないので、この記事は後で削除するかもしれない。