Help us understand the problem. What is going on with this article?

apt-key del するときのIDは最後8文字

apt-keyはapt用のGPG公開鍵を管理するコマンドです。3rd partyのリポジトリを追加するときなどに利用します。

ところで、誤って登録してしまった公開鍵を消すのに意外と苦労したので紹介します(apt-key listの出力が昔と変わっていて、古い情報がヒットしてしまった可能性がありそう)

消し方

登録済みの公開鍵を削除するコマンドは次の形式になります。

# apt-key del <keyid>

このkeyidというのは、finger printの最後の8文字のことです。

$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
...

pub   rsa2048 2017-02-20 [SC]
      9DD9 479D 06BA A713 2280  3AC1 6633 2B78 417E 73EA
uid           [ unknown] Hatena Co., Ltd. <admin@mackerel.io>

...

上記の鍵は次のように削除できます。

$ sudo apt-key del 417E73EA
OK

ネタ元

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away