Amazon Linux 2023 の OS アップデートを行う

SSH で接続すると毎回 OS アップデートの知らせ的なのが流れるので、
OS のアップデートを行ってみた。

環境

  • Amazon Linux 2023

OS アップデート

基本的に下記の通りやってみる。

注意点

  • dnf --releasever=latest update はしない。バージョン指定する
  • バージョンを上げる前に AMI でイメージを作成しておく
  • メジャーバージョンの更新の場合は、別途新しいインスタンスを起動させて、各種アプリケーションのテストをしてから、アップデートを行う

入手可能なバージョンを調べる

$ sudo dnf check-release-update

WARNING:
  A newer release of "Amazon Linux" is available.

  Available Versions:

  Version 2023.6.20250203:
    Run the following command to upgrade to 2023.6.20250203:

      dnf upgrade --releasever=2023.6.20250203

    Release notes:
     https://docs.aws.amazon.com/linux/al2023/release-notes/relnotes-2023.6.20250203.html

  Version 2023.6.20250211:
    Run the following command to upgrade to 2023.6.20250211:

      dnf upgrade --releasever=2023.6.20250211

    Release notes:
     https://docs.aws.amazon.com/linux/al2023/release-notes/relnotes-2023.6.20250211.html

  Version 2023.6.20250218:
    Run the following command to upgrade to 2023.6.20250218:

      dnf upgrade --releasever=2023.6.20250218

    Release notes:
     https://docs.aws.amazon.com/linux/al2023/release-notes/relnotes-2023.6.20250218.html

アップデート

$ sudo dnf upgrade --releasever=2023.6.20250218