2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PVE 9.0アップデート手順のリポジトリ設定がわからなかった話(aptの.listと.source)

Last updated at Posted at 2025-08-09

PVE9.0・PBS4 シリーズまとめ

概要

PVE9.0、PBS4.0が出たばかりのころに書いています。
そのうちドキュメントが修正されているかもしれません。

JPmoxsのイベントでアップデートのデモしました。

その中でaptのリポジトリ設定の理解が怪しかったので調べました。

イベントで参照していたのは以下のProxmox本家Wiki。

忙しい人向け

  • .listは古い形式、.sourceは新しい形式
  • .list、.sourceどちらの設定方法でもOK。
  • 公式ドキュメントを上から順番にやっていくとリポジトリ重複エラーが出る。
  • Optional: Modernize apt Repository Sources にあるapt modernize-sourcesはやったほうがいい。

.listは古い形式、.sourceは新しい形式

PVE8.0でのリポジトリ設定は以下ファイルで行ってました。
※デフォルト及び、GUIから追加した場合。
※手動で新しい形式にすることもできたはず。

  • /etc/apt/sources.list
    • Debianとno-subscriptionリポジトリ
  • /etc/apt/sources.list.d/pve-enterprise.list
    • enterpriseリポジトリ
  • /etc/apt/sources.list.d/ceph.list
    • ceph

この形式はPVE9.0でも利用可能ですが、apt的には新しい形式への移行が推奨のようで。
理由は1行での記載に限界があったから。

新しい形式の例は以下。

root@handson03:~# cat /etc/apt/sources.list.d/pve-enterprise.sources
Types: deb
URIs: https://enterprise.proxmox.com/debian/pve
Suites: trixie
Components: pve-enterprise
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg

この辺りの話は以下が参考になりました。

PVE8.0からPVE9.0にアップデートするときには新旧どちらの設定方法でもOK。

でも公式ドキュメントを上から順番にやっていくとリポジトリ重複エラーが出る。

公式ドキュメントでは以下のように記載されている。

  • Update Debian Base Repositories to Trixie
    • sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
    • sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/pve-enterprise.list
    • ※ceph.listだけ記載がない
  • Add the Proxmox VE 9 Package Repository
    • pveのenterpirise、no-subscriptionを.sourceで作成
  • Update the Ceph Package Repository
    • Cephを.sourceで作成

よく理解せずに上から順番にやっていくとPVEは新旧重複するので以下のようなエラーが出る。
※以下はsed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/ceph.listも実行したので、cephについても重複している。

root@handson01:~# apt update

(中略)

W: Target Packages (pve-no-subscription/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Packages (pve-no-subscription/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Translations (pve-no-subscription/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Translations (pve-no-subscription/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Packages (no-subscription/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Packages (no-subscription/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Translations (no-subscription/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Translations (no-subscription/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Packages (pve-no-subscription/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Packages (pve-no-subscription/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Translations (pve-no-subscription/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Translations (pve-no-subscription/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list.d/proxmox.sources:1
W: Target Packages (no-subscription/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Packages (no-subscription/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Translations (no-subscription/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1
W: Target Translations (no-subscription/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/ceph.list:1 and /etc/apt/sources.list.d/ceph.sources:1

そのため、重複しないように設定する必要がある。

Optional: Modernize apt Repository Sources にあるapt modernize-sourcesはやったほうがいい。

アップデート完了後、apt modernize-sources を実行すると設定が新しい形式に統一される。
将来的に古い形式がサポートされなくなる可能性もあるが、それ以上にPVEのGUI上からリポジトリ追加した際に新しい形式で追加されるので、このコマンドはアップデート終了後に実行したほうがいいと思う。

サンプル

新旧重複をしちゃったので、片方を無効化してアップデートした場合。
image.png

アップデート後にapt modernize-sourcesを実行した場合。
image.png

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?