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

【2025年01月版】Proxmox VE 8.3 で構築した開発環境に自動アップデートを入れてみる【unattended-upgrades】

Posted at

はじめに

開発環境が多くて、定期的にアップデートと再起動やるのめんどくさいなぁ

セキュリティアップデートと再起動とか自動でやってくれたらいいのに

そうだ、unattended-upgrades でやろ、のメモ

設定

セキュリティアップデートして必要であれば再起動してくれる設定
セキュリティアップデートはデフォルトでしてくれるようになっているはず

$ sudo apt install unattended-upgrades  # デフォルトで入っているから必要ないはず
$ sudo vim /etc/apt/apt.conf.d/50unattended-upgrades
$ sudo dpkg-reconfigure unattended-upgrades

修正箇所 1

Unattended-Upgrade::Origins-Pattern に Proxmox を追加。セキュリティだけなら必要ないかも。

/etc/apt/apt.conf.d/50unattended-upgrades
"origin=Proxmox,codename=${distro_codename},label=Proxmox Debian Repository";

修正箇所 2

/etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Automatic-Reboot "true";        # 自動再起動を有効化
Unattended-Upgrade::Automatic-Reboot-Time "04:00";  # 再起動時間指定

自動アップデートがおこなわれいないようなら、以下の設定になっているか確認する

/etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";         # パッケージリストの自動更新
APT::Periodic::Unattended-Upgrade "1";           # 自動アップデートの有効化

確認

手動による実行テスト

$ sudo unattended-upgrades --dry-run --debug

実行ログの確認

$ sudo less /var/log/unattended-upgrades/unattended-upgrades.log

さいごに

かんたんでしたね

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