0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry PiにMosquittoのインストールとGPGキーの削除

Posted at

Raspberry PiにMosquittoのクライアントをインストールしてMeshbluと直接MQTT通信してみます。MosquittoはRaspbianからデフォルトでapt-get installもできますが、mosquitto_pub--helpフラグをつけてもバージョンが表示されないのでMosquitto Debian repositoryを使うことにします。

インストール

Mosquitto Debian repositoryという記事に手順があるので従います。

$ curl -O http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
$ sudo apt-key add mosquitto-repo.gpg.key
$ rm mosquitto-repo.gpg.key
$ cd /etc/apt/sources.list.d/
$ sudo curl -O http://repo.mosquitto.org/debian/mosquitto-repo.list
$ sudo apt-get update

MQTTブローカーはRaspberry Piに不要なのでMQTTクライアントのみインストールします。

$ sudo apt-get install mosquitto-clients

--helpフラグをつけてバージョンを確認します。

$ mosquitto_pub --help
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 1.3.5 running on libmosquitto 1.3.5.

パッケージとGPGキーの削除

一度きれいにパッケージを削除したかったのですが、GPGキーの削除方法がわからなかったので調べました。まずは普通にパッケージの削除とsources.listの削除をします。

$ sudo apt-get remove --purge mosquitto-clients
$ sudo sudo rm /etc/apt/sources.list.d/mosquitto-repo.list

GPGキーの削除はapt-key delコマンドを使います。引数にkeyidを指定しますが何がkeyidなのかよくわかりません。Removing an unused GPG key?を参考にします。apt-key listを実行してMosquittoリポジトリを探します。4096R/30993623のスラッシュより後半部分がkeyidのようです。

$ sudo apt-key list
pub   4096R/30993623 2013-01-04 [expires: 2018-01-03]
uid                  Mosquitto Apt Repository <repo@mosquitto.org>

apt-key delkeyidを指定するとGPGキーが削除できました。apt-key listを実行してもMosquittoリポジトリが表示されなくなります。

$ sudo apt-key del 30993623
OK
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?