
壊れた gpg を修正する方法を見つけるのに頭を悩ませていますapt
。
Nodejs をインストールしようとすると:
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
このエラーが発生します:
## You seem to be using Debian version stretch.
## This maps to Debian "jessie"... Adjusting for you...
## Confirming "jessie" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_7.x/dists/jessie/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
gpg: [don't know]: invalid packet (ctb=00)
gpg: keydb_get_keyblock failed: Valeur non trouvée
gpg: [don't know]: invalid packet (ctb=00)
gpg: /tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg: copy to '/tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg.tmp' failed: Paquet incorrect
gpg: error writing keyring '/tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg': Paquet incorrect
gpg: [don't know]: invalid packet (ctb=00)
gpg: error reading '-': Paquet incorrect
gpg: import from '-' failed: Paquet incorrect
Error executing command, exiting
私はカーネル 10.5 の Debian Stretch RC2 を使用しています。これが問題かどうかはわかりません。Ryzen プロセッサで実行しているため、Debian の安定バージョンは使用できません。
VSCode をインストールしようとすると、別のエラーも発生しました:
W: Erreur de GPG : http://packages.microsoft.com/repos/vscode stable InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY EB3E94ADBE1229CF
W: The repository 'http://packages.microsoft.com/repos/vscode stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
何か案が?
[編集] これは私のソースリストです
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch main non-free contrib
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch main non-free contrib
deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free
# stretch-updates, previously known as 'volatile'
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-updates main contrib non-free
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-updates main contrib non-free
# stretch-backports, previously on backports.debian.org
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-backports main contrib non-free
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-backports main contrib non-free
# deb [arch=amd64] https://download.docker.com/linux/debian/ stretch stable
# deb-src [arch=amd64] https://download.docker.com/linux/debian/ stretch stable
deb http://www.deb-multimedia.org/ stretch main non-free
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
答え1
これは古い質問であり、出来事によって克服される (OBE) 可能性があることを理解しています...ただし...
偶然にも同時に発生した問題がいくつかあるようです。
問題1: Nodejs リポジトリ GPG 公開鍵
キーのダウンロードには問題がなかったので、おそらくその日はリポジトリに接続の問題か、その他の不具合があったのでしょう。
リポジトリの公開キーを読み取るテストは次のとおりです。
$ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key |gpg --list-packets
# off=0 ctb=99 tag=6 hlen=3 plen=525
:public key packet:
version 4, algo 1, created 1402676406, expires 0
pkey[0]: [4096 bits]
pkey[1]: [17 bits]
keyid: 1655A0AB68576280
# off=528 ctb=b4 tag=13 hlen=2 plen=31
:user ID packet: "NodeSource <[email protected]>"
# off=561 ctb=89 tag=2 hlen=3 plen=568
:signature packet: algo 1, keyid 1655A0AB68576280
version 4, created 1402676406, md5len 0, sigclass 0x13
digest algo 2, begin of digest 74 e6
hashed subpkt 2 len 4 (sig created 2014-06-13)
hashed subpkt 27 len 1 (key flags: 03)
hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
hashed subpkt 30 len 1 (features: 01)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID 1655A0AB68576280)
data: [4095 bits]
# off=1132 ctb=b9 tag=14 hlen=3 plen=525
:public sub key packet:
version 4, algo 1, created 1402676406, expires 0
pkey[0]: [4096 bits]
pkey[1]: [17 bits]
keyid: 6C5CDECAAA01DA2C
# off=1660 ctb=89 tag=2 hlen=3 plen=543
:signature packet: algo 1, keyid 1655A0AB68576280
version 4, created 1402676406, md5len 0, sigclass 0x18
digest algo 2, begin of digest 83 d0
hashed subpkt 2 len 4 (sig created 2014-06-13)
hashed subpkt 27 len 1 (key flags: 0C)
subpkt 16 len 8 (issuer key ID 1655A0AB68576280)
data: [4096 bits]
問題2: Microsoft リポジトリ GPG 公開キー
ここでの問題は、Microsoft 公開キーが Microsoft リポジトリ サーバー上の別のディレクトリに配置されていることです。
キーファイルは次の場所で見つかりました:
https://packages.microsoft.com/keys/microsoft.asc
以下は、Microsoft のリポジトリの公開キーを読み取るための私のテストです。
$ curl -s https://packages.microsoft.com/keys/microsoft.asc |gpg --list-packets
# off=0 ctb=99 tag=6 hlen=3 plen=269
:public key packet:
version 4, algo 1, created 1446074508, expires 0
pkey[0]: [2048 bits]
pkey[1]: [17 bits]
keyid: EB3E94ADBE1229CF
# off=272 ctb=b4 tag=13 hlen=2 plen=55
:user ID packet: "Microsoft (Release signing) <[email protected]>"
# off=329 ctb=89 tag=2 hlen=3 plen=309
:signature packet: algo 1, keyid EB3E94ADBE1229CF
version 4, created 1446074508, md5len 0, sigclass 0x13
digest algo 2, begin of digest 1a 9b
hashed subpkt 2 len 4 (sig created 2015-10-28)
hashed subpkt 27 len 1 (key flags: 03)
hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
hashed subpkt 21 len 3 (pref-hash-algos: 2 8 3)
hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
hashed subpkt 30 len 1 (features: 01)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID EB3E94ADBE1229CF)
data: [2047 bits]
問題3: リポジトリ URL にスラッシュがありません
/etc/apt/sources.list
Microsoft のリポジトリの行にスラッシュがありません。
この行:
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
正しくは:
deb [arch=amd64] http://packages.microsoft.com/repos/vscode/ stable main
完全なソリューション
- インストールを再試行してください
nodejs
- 不足しているスラッシュを追加します
/etc/apt/sources.list
- Microsoft のリポジトリ署名キーをダウンロードして追加します。
curl -s https://packages.microsoft.com/keys/microsoft.asc |apt-key add -