Skip to content

Amazon Linux 2023 をアップグレードする

放置してあった (!) Amazon Linux 2023 へ久しぶりにログインしたところ、ログイン時に以下のメッセージが表示されました。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
A newer release of "Amazon Linux" is available.
  Version 2023.1.20230906:
  Version 2023.1.20230912:
  Version 2023.2.20230920:
  Version 2023.2.20231002:
  Version 2023.2.20231011:
  Version 2023.2.20231016:
Run "/usr/bin/dnf check-release-update" for full release and version update info
   ,     #_
   ~\_  ####_        Amazon Linux 2023
  ~~  \_#####\
  ~~     \###|
  ~~       \#/ ___   https://aws.amazon.com/linux/amazon-linux-2023
   ~~       V~' '->
    ~~~         /
      ~~._.   _/
         _/ _/
       _/m/'

今回は Amazon Linux 2023 のアップグレード手順をメモしておきます。

アップデート有無の確認

アップデートの有無は dnf check-release-update で確認出来ます。 アップデートが大量にあります… orz

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# dnf check-release-update
WARNING:
  A newer release of "Amazon Linux" is available.

  Available Versions:

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

      dnf upgrade --releasever=2023.1.20230906

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

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

      dnf upgrade --releasever=2023.1.20230912

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

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

      dnf upgrade --releasever=2023.2.20230920

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

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

      dnf upgrade --releasever=2023.2.20231002

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

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

      dnf upgrade --releasever=2023.2.20231011

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

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

      dnf upgrade --releasever=2023.2.20231016

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

アップグレード内容の確認

前の手順で確認した内容から、最新のリリースバージョンを指定し、アップグレード内容を確認してみます。 dnf check-upgrade --releasever=2023.2.20231016 のように実行しますが、リリースバージョン (--releasever) の部分は dnf check-release-update で確認した内容から転記します。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# dnf check-upgrade --releasever=2023.2.20231016
Amazon Linux 2023 repository                                                                37 MB/s |  20 MB     00:00
Last metadata expiration check: 0:00:06 ago on Sun Oct 22 01:20:50 2023.

amazon-ec2-net-utils.noarch                               2.4.0-1.amzn2023.0.1                                  amazonlinux
amazon-linux-repo-s3.noarch                               2023.2.20231016-0.amzn2023                            amazonlinux
amazon-ssm-agent.x86_64                                   3.2.1630.0-1.amzn2023                                 amazonlinux
bind-libs.x86_64                                          32:9.16.42-1.amzn2023.0.5                             amazonlinux
bind-license.noarch                                       32:9.16.42-1.amzn2023.0.5                             amazonlinux
bind-utils.x86_64                                         32:9.16.42-1.amzn2023.0.5                             amazonlinux
binutils.x86_64                                           2.39-6.amzn2023.0.9                                   amazonlinux
cloud-init.noarch                                         22.2.2-1.amzn2023.1.11                                amazonlinux
curl-minimal.x86_64                                       8.3.0-1.amzn2023.0.2                                  amazonlinux
docker.x86_64                                             24.0.5-1.amzn2023.0.1                                 amazonlinux
file.x86_64                                               5.39-7.amzn2023.0.4                                   amazonlinux
file-libs.x86_64                                          5.39-7.amzn2023.0.4                                   amazonlinux
fonts-srpm-macros.noarch                                  1:2.0.5-12.amzn2023.0.2                               amazonlinux
glib2.x86_64                                              2.74.7-689.amzn2023.0.2                               amazonlinux
glibc.x86_64                                              2.34-52.amzn2023.0.6                                  amazonlinux
glibc-all-langpacks.x86_64                                2.34-52.amzn2023.0.6                                  amazonlinux
glibc-common.x86_64                                       2.34-52.amzn2023.0.6                                  amazonlinux
glibc-gconv-extra.x86_64                                  2.34-52.amzn2023.0.6                                  amazonlinux
glibc-locale-source.x86_64                                2.34-52.amzn2023.0.6                                  amazonlinux
go-srpm-macros.noarch                                     3.2.0-37.amzn2023                                     amazonlinux
kernel.x86_64                                             6.1.55-75.123.amzn2023                                amazonlinux
kernel-livepatch-repo-s3.noarch                           2023.2.20231016-0.amzn2023                            amazonlinux
kernel-tools.x86_64                                       6.1.55-75.123.amzn2023                                amazonlinux
krb5-libs.x86_64                                          1.21-3.amzn2023.0.3                                   amazonlinux
libcurl-minimal.x86_64                                    8.3.0-1.amzn2023.0.2                                  amazonlinux
libffi.x86_64                                             3.4.4-1.amzn2023.0.1                                  amazonlinux
libgcc.x86_64                                             11.4.1-2.amzn2023.0.2                                 amazonlinux
libgcrypt.x86_64                                          1.10.2-1.amzn2023.0.1                                 amazonlinux
libgomp.x86_64                                            11.4.1-2.amzn2023.0.2                                 amazonlinux
libidn2.x86_64                                            2.3.2-1.amzn2023.0.5                                  amazonlinux
libnghttp2.x86_64                                         1.57.0-1.amzn2023.0.1                                 amazonlinux
libstdc++.x86_64                                          11.4.1-2.amzn2023.0.2                                 amazonlinux
libtasn1.x86_64                                           4.19.0-1.amzn2023.0.4                                 amazonlinux
libxml2.x86_64                                            2.10.4-1.amzn2023.0.5                                 amazonlinux
nspr.x86_64                                               4.35.0-5.amzn2023.0.3                                 amazonlinux
nss.x86_64                                                3.90.0-3.amzn2023.0.3                                 amazonlinux
nss-softokn.x86_64                                        3.90.0-3.amzn2023.0.3                                 amazonlinux
nss-softokn-freebl.x86_64                                 3.90.0-3.amzn2023.0.3                                 amazonlinux
nss-sysinit.x86_64                                        3.90.0-3.amzn2023.0.3                                 amazonlinux
nss-util.x86_64                                           3.90.0-3.amzn2023.0.3                                 amazonlinux
openssh.x86_64                                            8.7p1-8.amzn2023.0.8                                  amazonlinux
openssh-clients.x86_64                                    8.7p1-8.amzn2023.0.8                                  amazonlinux
openssh-server.x86_64                                     8.7p1-8.amzn2023.0.8                                  amazonlinux
openssl.x86_64                                            1:3.0.8-1.amzn2023.0.7                                amazonlinux
openssl-libs.x86_64                                       1:3.0.8-1.amzn2023.0.7                                amazonlinux
p11-kit.x86_64                                            0.24.1-2.amzn2023.0.3                                 amazonlinux
p11-kit-trust.x86_64                                      0.24.1-2.amzn2023.0.3                                 amazonlinux
python3.x86_64                                            3.9.16-1.amzn2023.0.6                                 amazonlinux
python3-cffi.x86_64                                       1.14.5-1.amzn2023.0.3                                 amazonlinux
python3-libs.x86_64                                       3.9.16-1.amzn2023.0.6                                 amazonlinux
sudo.x86_64                                               1.9.13-1.p2.amzn2023.0.4                              amazonlinux
system-release.noarch                                     2023.2.20231016-0.amzn2023                            amazonlinux
systemd.x86_64                                            252.16-1.amzn2023.0.1                                 amazonlinux
systemd-libs.x86_64                                       252.16-1.amzn2023.0.1                                 amazonlinux
systemd-networkd.x86_64                                   252.16-1.amzn2023.0.1                                 amazonlinux
systemd-pam.x86_64                                        252.16-1.amzn2023.0.1                                 amazonlinux
systemd-resolved.x86_64                                   252.16-1.amzn2023.0.1                                 amazonlinux
systemd-udev.x86_64                                       252.16-1.amzn2023.0.1                                 amazonlinux
update-motd.noarch                                        2.1-1.amzn2023.0.1                                    amazonlinux
userspace-rcu.x86_64                                      0.12.1-3.amzn2023.0.4                                 amazonlinux
vim-common.x86_64                                         2:9.0.1882-1.amzn2023.0.1                             amazonlinux
vim-data.noarch                                           2:9.0.1882-1.amzn2023.0.1                             amazonlinux
vim-enhanced.x86_64                                       2:9.0.1882-1.amzn2023.0.1                             amazonlinux
vim-filesystem.noarch                                     2:9.0.1882-1.amzn2023.0.1                             amazonlinux
vim-minimal.x86_64                                        2:9.0.1882-1.amzn2023.0.1                             amazonlinux
xxd.x86_64                                                2:9.0.1882-1.amzn2023.0.1                             amazonlinux

アップグレードする

全てのパッケージを最新にするには以下を実行します。

1
dnf -y upgrade --releasever=latest