公開鍵がないため、aptを使用したSublime Textのインストールに失敗しました

公開鍵がないため、aptを使用したSublime Textのインストールに失敗しました

私はsublime-textをインストールするための適切な設定のために以下のリンクされた指示を使用しています。 Sublimeをサードパーティのリポジトリの例として使用して、DebianとStackexchangeのページに記載されているサードパーティのリポジトリを接続する方法を意図的に適用しました。

https://www.sublimetext.com/docs/linux_repositories.html

https://wiki.debian.org/DebianRepository/UseThirdParty

サードパーティのストレージを追加する方法。 Debianのキー?

ただし、実行時にapt update暗号化キーに関して次のエラーが発生します。

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F57D4F59BD3DF454

これが私がすることです:

キーをダウンロードし、キーをASCIIからバイナリに変換し、キーを共有場所に移動します。

curl https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor > ~/Downloads/sublime-keyring.gpg
sudo mkdir -vp /usr/local/share/keyrings/
sudo mv -v ~/Downloads/sublime-keyring.gpg /usr/local/share/keyrings/sublime-keyring.gpg
sudo chown -v root:root /usr/local/share/keyrings/sublime-keyring.gpg
sudo chmod -v 0640 /usr/local/share/keyrings/sublime-keyring.gpg

ソースリストを作成します。

printf "deb [signed-by=/usr/local/share/keyrings/sublime-keyring.gpg] https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

ストレージの使用を制限する固定ルールを設定します。

printf "%s\n" "Package: *" "Pin: origin download.sublimetext.com" "Pin-Priority: 1" "" "Package: sublime-text" "Pin: origin download.sublimetext.com" "Pin-Priority: 500" | sudo tee /etc/apt/preferences.d/sublime-text.pref

次に、sudo apt updateSublime Textリポジトリに関連して次の出力を生成して実行します。

Get:1 https://download.sublimetext.com apt/stable/ InRelease [2.536 B]                                                                    
Err:1 https://download.sublimetext.com apt/stable/ InRelease                                                                                     
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F57D4F59BD3DF454

W: GPG error: https://download.sublimetext.com apt/stable/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F57D4F59BD3DF454
E: The repository 'https://download.sublimetext.com apt/stable/ InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

gpgのdebugを使用して実行すると、sudo apt -o Debug::Acquire::gpgv=True updateより詳細な情報が得られます。

Get:1 https://download.sublimetext.com apt/stable/ InRelease [2.536 B]                                                                   
0% [Waiting for headers] [Waiting for headers]inside VerifyGetSigners                                                                    
Preparing to exec:  /usr/bin/apt-key --quiet --readonly --keyring /usr/local/share/keyrings/sublime-keyring.gpg verify --status-fd 3 /tmp/apt.sig.zwA50y /tmp/apt.data.zbzsmw
Read: [GNUPG:] NEWSIG

Read: [GNUPG:] ERRSIG F57D4F59BD3DF454 1 8 01 1627009220 9 -

Got ERRSIG F57D4F59BD3DF454 !
Read: [GNUPG:] NO_PUBKEY F57D4F59BD3DF454

Got NO_PUBKEY F57D4F59BD3DF454 !
gpgv exited with status 2
Summary:
  Good: 
  Valid: 
  Bad: 
  Worthless: 
  SoonWorthless: 
  NoPubKey: NO_PUBKEY F57D4F59BD3DF454
  Signed-By: 
  NODATA: no
Err:1 https://download.sublimetext.com apt/stable/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F57D4F59BD3DF454

W: GPG error: https://download.sublimetext.com apt/stable/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F57D4F59BD3DF454
E: The repository 'https://download.sublimetext.com apt/stable/ InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

これはaptが私がダウンロードしたキーの位置を正しく渡すという意味であることを読んだ。これは、gpgがキーの内容を読み取れないことを意味します。あるいは、脱型の過程でキーが損傷し、意図した内容がなくなった可能性があります。これは純粋に私の推測です。

Dear Keyを確認すると、sudo gpg --show-keys /usr/local/share/keyrings/sublime-keyring.gpg次の情報が表示されますが、これは正しいようです。

pub   rsa4096 2017-05-08 [SCEA]
      1EDDE2CDFC025D17F6DA9EC0ADAE6AD28A8F901A
uid                      Sublime HQ Pty Ltd <[email protected]>
sub   rsa4096 2017-05-08 [S]

言及されていませんが、キーを読むことができますF57D4F59BD3DF454

それでは何が間違っていますか?どうすれば正しく動作させることができますか?

ベストアンサー1

公開鍵ファイルを読み取るすべてのプロセスにrootアクセス権があるとします。しかし、それは本当ではないかもしれないことが判明しました。

権限を設定すると、0640私が報告した問題が発生し、設定すると0644問題が解決されるためです。

更新されたコマンドは次のとおりです。

sudo chmod -v 0644 /usr/local/share/keyrings/sublime-keyring.gpg

この変更により、質問に記載されているプロセスを使用してSublime Textを更新してインストールできました。

おすすめ記事