apt update のエラーの対処方法(Warning: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. OpenPGP signature verification failed: https://developer.download.nvidia.com/compute/cuda/repos/deb

apt updateで以下のエラー(厳密には警告?)が出る場合の対処法です。2026年2月以降、CUDAや生成AIを使っているサーバーで頻出するエラーになると思われるのでエントリとして書いておきます。

エラーメッセージ

Warning: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. OpenPGP signature verification failed: https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64  InRelease: Sub-process /usr/bin/sqv returned an error code (1), error message is: Signing key on EB693B3035CD5710E231E123A4B469963BF863CC is not bound:            No binding signature at time 2026-01-29T20:38:07Z   because: Policy rejected non-revocation signature (PositiveCertification) requiring second pre-image resistance   because: SHA1 is not considered secure since 2026-02-01T00:00:00Z

修正方法

設定ファイル /usr/share/apt/default-sequoia.config に以下の行があるので

[hash_algorithms]
sha1.second_preimage_resistance = 2026-02-01    # Extend the expiry for legacy repositories

ここの日付を 2028-02-01 などに変更すると警告が消えます

詳細

詳細を以下のエントリに書いてます。よろしければ併せてご覧ください

pyopyopyo.hatenablog.com

リモートサーバー上で jupyter を常時稼働する方法(systemdによるサービス化)

リモートサーバー上で JupyterLab を使っている場合を想定し,サーバー(Linux)を起動すると自動で JupyterLab が起動するようにする設定を紹介します.


この設定のメリット

Linuxを起動すると自動で jupyterが起動
いちいちSSH でサーバにログインしてから JupyterLab を起動する,という手順が不要になります.
Linuxを起動しているかぎり, jupyter は稼働し続ける
SSHが切れると jupyterも止まる,といった残念な事故が起きなくなります
root権限が不要
研究室や職場の共用サーバー上でも簡単に設定できます

設定方法

設定手順1:jupyter-labのパスワードを設定する

リモートサーバー上で使う JupyterLab が起動したままになるので,
セキュリティ的配慮として,あらかじめjupyterlabのパスワードを設定しておきます.

SSHでリモートサーバーにログインして,以下のコマンドを実行し,パスワードを設定してください

$ jupyter-lab password

設定手順2:systemdの設定ファイルを作成する

以下の設定ファイルを作成します ~/.config/systemd/user/jupyter-lab.service で,設定ファイルを作成します.root権限は使わず,自分のアカウント(一般ユーザ)で作業してください

[Unit]
Description=Jupyter lab
After=network.target

[Service]
Type=simple
ExecStart=/bin/bash -lc "jupyter-lab --no-browser --ip=127.0.0.1 --port=8888 "

WorkingDirectory=%h
Restart=on-failure
RestartSec=0

[Install]
WantedBy=default.target

設定手順3:systemdのサービスとして登録する

ユーザ権限で以下のコマンドを実行します(root権限は不要です)

$ systemctl --user daemon-reload
$ systemctl --user enable jupyter-lab
$ loginctl enable-linger $USER
$ systemctl --user start jupyter-lab

コマンドの意味は,上から

  • 設定ファイルの再読み込み(reload)
  • JupyterLab を自動起動するための設定
  • ログインしていなくてもユーザサービスを起動できるようにする
  • 今回は手動で jupyterを起動

です

これで,リモートサーバー上で JupyterLab が常駐起動するようになります.

あとは SSH のポートフォワードなどを使って,ローカル PC のブラウザから 8888 ポートに接続するだけです.


ポイント

ポイント1:jupyterは一般ユーザ権限で起動する

root権限は使いません.自分のアカウント,つまり一般ユーザ権限をつかいます.

ポイント2: ログインシェル経由でjupyterを起動する

上記の設定では,ログインシェルとして /bin/bash を使い,bash 経由で JupyterLab を起動しています.

リモートサーバー環境では,

  • ログインシェル経由(~/.profile や ~/.bashrc が読まれる)
  • systemd などから直接起動(これらが読まれない)

という違いから,起動する Python や Jupyter のバージョンや挙動が変わることがあります.

そこで上記の設定では,明示的にログインシェルを経由することで,普段 SSH でログインして起動しているのと同じ環境でJupyterLab が起動するようにしています.

ポイント3:port番号はsystemd側で指定する

ポート番号は,systemd側で明示的に指定しています.具体的には,設定ファイルの以下の行です.

ExecStart=/bin/bash -lc "jupyter-lab --no-browser --ip=127.0.0.1 --port=8888 "

なお,ポート番号は Jupyter 側の設定ファイルでも指定できますが,Jupyter の設定ファイルはデフォルトのままで変更せず,ポート番号のみを上記の方法(systemd の設定ファイル)で指定しておいたほうが,設定全体を単純に保てるように思います.

トラブルシューティング

うまく行かない場合は以下の点を確認してみてください

状態をみる

systemdのサービス稼働状態を確認するには,以下のコマンドを実行します

$ systemctl --user status jupyter-lab

ログを見る

以下のコマンドでログが確認できます

$ journalctl --user -u jupyter-lab -f