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?

Proxmox VE 9.0 リポジトリ設定のdeb822形式への移行

Last updated at Posted at 2025-08-24

はじめに

Proxmox VE 9.0アップグレード完了後、リポジトリ設定を新しいdeb822形式に移行することができます。本記事では、従来の.list形式から新形式への移行手順と、その利点について解説します。

deb822形式とは

従来形式との比較

従来の形式(.list)

# /etc/apt/sources.list.d/pve-no-subscription.list
deb http://download.proxmox.com/debian/pve trixie pve-no-subscription

新形式(.sources / deb822)

# /etc/apt/sources.list.d/proxmox.sources
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg

新形式の利点

項目 従来形式 新形式(deb822)
可読性 1行にすべての情報 項目別に分離
管理性 複数行で複雑化 構造化された設定
署名管理 別途管理が必要 設定内で完結
拡張性 制限あり 豊富なオプション
エラー検出 困難 項目別に検証可能

移行前の準備

現在の設定確認

現在のリポジトリ設定を確認

image.png

上記のように、.list形式と.sources形式のリポジトリが混在しています。

# 現在のリポジトリファイル一覧
ls -la /etc/apt/sources.list.d/

# 現在の設定内容確認
cat /etc/apt/sources.list
find /etc/apt/sources.list.d/ -name "*.list" -exec echo "=== {} ===" \; -exec cat {} \;
root@tx1320m1:~# ls -la /etc/apt/sources.list.d/
total 32
drwxr-xr-x 2 root root   7 Aug 24 15:43 .
drwxr-xr-x 9 root root  12 Aug 24 13:42 ..
-rw-r--r-- 1 root root  77 Aug 11 20:12 ceph.list
-rw-r--r-- 1 root root 162 Aug 24 13:04 proxmox.sources
-rw-r--r-- 1 root root  71 Aug 24 13:06 pve-enterprise.list
-rw-r--r-- 1 root root 160 Aug 13 20:00 pve-enterprise.sources
-rw-r--r-- 1 root root 176 Aug 24 13:06 pve-enterprise.sources.dpkg-old
root@tx1320m1:~# cat /etc/apt/sources.list
find /etc/apt/sources.list.d/ -name "*.list" -exec echo "=== {} ===" \; -exec cat {} \;
deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
=== /etc/apt/sources.list.d/pve-enterprise.list ===
# deb https://enterprise.proxmox.com/debian/pve trixie pve-enterprise

=== /etc/apt/sources.list.d/ceph.list ===
# deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise

パッケージ更新状況の確認

# 現在のパッケージ状況
apt update
apt list --upgradable

# Proxmoxバージョン確認
pveversion
root@tx1320m1:~# apt update
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://deb.debian.org/debian trixie-updates InRelease
Hit:3 http://security.debian.org/debian-security trixie-security InRelease
Hit:4 http://download.proxmox.com/debian/pve trixie InRelease
All packages are up to date.
root@tx1320m1:~# apt list --upgradable
root@tx1320m1:~# pveversion
pve-manager/9.0.5/9c5600b249dbfd2f (running kernel: 6.14.8-2-pve)

自動移行(modernize-sources)の実行

ステップ1: modernize-sourcesコマンドの実行

Proxmox VE 9.0では、Debianのapt modernize-sourcesコマンドが利用できます。

# 移行可能な設定の確認
apt modernize-sources

実行すると以下のような確認画面が表示されます:

This will create new '.sources' files and disable the old '.list' files.
The old files will be renamed with a '.bak' extension.
Do you want to continue? [y/N]
root@tx1320m1:~# apt modernize-sources
The following files need modernizing:
  - /etc/apt/sources.list
  - /etc/apt/sources.list.d/ceph.list
  - /etc/apt/sources.list.d/pve-enterprise.list

Modernizing will replace .list files with the new .sources format,
add Signed-By values where they can be determined automatically,
and save the old files into .list.bak files.

This command supports the 'signed-by' and 'trusted' options. If you
have specified other options inside [] brackets, please transfer them
manually to the output files; see sources.list(5) for a mapping.

For a simulation, respond N in the following prompt.
Rewrite 3 sources? [Y/n] n

nを入力してEnter

ステップ2: 変更内容の事前確認

# まず 'n' で内容確認
# 表示される変更内容を確認してから再実行
Simulating only...
Modernizing /etc/apt/sources.list...

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Modernizing /etc/apt/sources.list.d/ceph.list...

Modernizing /etc/apt/sources.list.d/pve-enterprise.list...

ステップ3: 実際の移行実行

# 実際の移行実行
apt modernize-sources
# 確認プロンプトで 'y' を選択
root@tx1320m1:~# apt modernize-sources
The following files need modernizing:
  - /etc/apt/sources.list
  - /etc/apt/sources.list.d/ceph.list
  - /etc/apt/sources.list.d/pve-enterprise.list

Modernizing will replace .list files with the new .sources format,
add Signed-By values where they can be determined automatically,
and save the old files into .list.bak files.

This command supports the 'signed-by' and 'trusted' options. If you
have specified other options inside [] brackets, please transfer them
manually to the output files; see sources.list(5) for a mapping.

For a simulation, respond N in the following prompt.
Rewrite 3 sources? [Y/n] Y
Modernizing /etc/apt/sources.list...
- Writing /etc/apt/sources.list.d/debian.sources

Modernizing /etc/apt/sources.list.d/ceph.list...

Modernizing /etc/apt/sources.list.d/pve-enterprise.list...

移行結果の確認

image.png

重複していたリポジトリがなくなりました。

ファイル構成の変化

# 新しい.sourcesファイルの確認
ls -la /etc/apt/sources.list.d/

# バックアップファイル(.bak)の確認
ls -la /etc/apt/sources.list.d/*.bak 2>/dev/null || echo "No backup files"

# 新しい設定ファイルの内容確認
find /etc/apt/sources.list.d/ -name "*.sources" -exec echo "=== {} ===" \; -exec cat {} \;
root@tx1320m1:~# ls -la /etc/apt/sources.list.d/
total 36
drwxr-xr-x 2 root root   8 Aug 24 16:55 .
drwxr-xr-x 9 root root  12 Aug 24 16:55 ..
-rw-r--r-- 1 root root  77 Aug 11 20:12 ceph.list.bak
-rw-r--r-- 1 root root 669 Aug 24 16:55 debian.sources
-rw-r--r-- 1 root root 162 Aug 24 13:04 proxmox.sources
-rw-r--r-- 1 root root  71 Aug 24 13:06 pve-enterprise.list.bak
-rw-r--r-- 1 root root 175 Aug 24 16:50 pve-enterprise.sources
-rw-r--r-- 1 root root 176 Aug 24 13:06 pve-enterprise.sources.dpkg-old
root@tx1320m1:~# ls -la /etc/apt/sources.list.d/*.bak 2>/dev/null || echo "No backup files"
-rw-r--r-- 1 root root 77 Aug 11 20:12 /etc/apt/sources.list.d/ceph.list.bak
-rw-r--r-- 1 root root 71 Aug 24 13:06 /etc/apt/sources.list.d/pve-enterprise.list.bak
root@tx1320m1:~# find /etc/apt/sources.list.d/ -name "*.sources" -exec echo "=== {} ===" \; -exec 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
Enabled: false
=== /etc/apt/sources.list.d/debian.sources ===
# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Modernized from /etc/apt/sources.list
Types: deb
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
=== /etc/apt/sources.list.d/proxmox.sources ===
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg

設定の検証

パッケージリストの更新テスト

# 新しい設定でのパッケージリスト更新
apt update

# エラーがないことを確認
echo $?  # 0 が表示されれば成功
root@tx1320m1:~# apt update
Hit:1 http://security.debian.org/debian-security trixie-security InRelease
Hit:2 http://deb.debian.org/debian trixie InRelease
Hit:3 http://deb.debian.org/debian trixie-updates InRelease
Hit:4 http://download.proxmox.com/debian/pve trixie InRelease
All packages are up to date.
root@tx1320m1:~# echo $?
0

リポジトリ認識の確認

# 利用可能なリポジトリ確認
apt policy

# Proxmox関連パッケージの確認
apt policy pve-manager proxmox-ve
root@tx1320m1:~# apt policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     release o=Proxmox,a=stable,n=trixie,l=Proxmox Debian Repository,c=pve-no-subscription,b=amd64
     origin download.proxmox.com
 500 http://security.debian.org/debian-security trixie-security/main amd64 Packages
     release v=13,o=Debian,a=stable-security,n=trixie-security,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://deb.debian.org/debian trixie-updates/main amd64 Packages
     release v=13-updates,o=Debian,a=stable-updates,n=trixie-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/non-free-firmware amd64 Packages
     release v=13.0,o=Debian,a=stable,n=trixie,l=Debian,c=non-free-firmware,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/non-free amd64 Packages
     release v=13.0,o=Debian,a=stable,n=trixie,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/contrib amd64 Packages
     release v=13.0,o=Debian,a=stable,n=trixie,l=Debian,c=contrib,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/main amd64 Packages
     release v=13.0,o=Debian,a=stable,n=trixie,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:
root@tx1320m1:~# apt policy pve-manager proxmox-ve
pve-manager:
  Installed: 9.0.5
  Candidate: 9.0.5
  Version table:
 *** 9.0.5 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
        100 /var/lib/dpkg/status
     9.0.4 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.3 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~22 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~21 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~20 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~19 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~18 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~17 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~16 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~15 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~14 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~12 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~11 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~10 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~9 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
     9.0.0~8 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
proxmox-ve:
  Installed: 9.0.0
  Candidate: 9.0.0
  Version table:
 *** 9.0.0 500
        500 http://download.proxmox.com/debian/pve trixie/pve-no-subscription amd64 Packages
        100 /var/lib/dpkg/status

旧ファイルのクリーンアップ

バックアップファイルの管理

移行完了後、動作確認ができたらバックアップファイルを整理できます。

# バックアップファイルの確認
ls -la /etc/apt/sources.list.d/*.bak

# 動作確認後、不要になったバックアップの削除(慎重に)
# sudo rm /etc/apt/sources.list.d/*.bak

古い設定の完全削除前チェック

# 新しい設定での最終動作確認
apt update && apt list --upgradable

# システム全体の正常性確認
systemctl status pve-cluster pvedaemon pveproxy

トラブルシューティング

問題: 移行の取り消し

# 問題が発生した場合の復旧方法
# 1. 新しい.sourcesファイルを無効化
mv /etc/apt/sources.list.d/*.sources /tmp/

# 2. バックアップファイルを復元
for bakfile in /etc/apt/sources.list.d/*.bak; do
    if [[ -f "$bakfile" ]]; then
        mv "$bakfile" "${bakfile%.bak}"
    fi
done

# 3. 動作確認
apt update

移行の利点まとめ

✅ 得られるメリット

  1. 管理性向上

    • 設定項目が明確に分離
    • 複雑な設定の可読性向上
  2. エラー診断改善

    • 項目別のエラー特定が容易
    • 設定の妥当性検証が向上
  3. 将来性

    • Debian標準の推奨形式
    • 新機能への対応
  4. 署名管理統合

    • GPGキー管理が設定内で完結
    • セキュリティ設定の明確化

まとめ

Proxmox VE 9.0でのリポジトリ近代化により:

🎯 主な改善点

  • 構造化された設定: 項目別の明確な分離
  • 管理効率向上: エラー診断と保守性の改善
  • 標準準拠: Debian推奨形式への移行
  • 将来対応: 新機能への準備

🔧 実施手順

  1. apt modernize-sources で自動移行
  2. 設定内容の確認と検証
  3. 動作確認後のクリーンアップ

この近代化により、より保守しやすく将来に対応したProxmox VE環境を構築できます。


注意: 移行は任意ですが、新しい形式の利点を活用することが出来ます。移行前には必ずバックアップを確保し、テスト環境での検証を行ってください。

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?