AWS Security ChangesHomeSearch

AWS linux documentation change

Service: linux · 2026-06-07 · Documentation low

File: linux/al2023/ug/kernel-update.md

Summary

Simplified kernel upgrade/downgrade commands and added dependency handling for kernel-tools packages

Security assessment

The changes optimize package management commands for kernel updates without addressing security vulnerabilities or introducing security features. The modifications are operational improvements to the update process.

Diff

diff --git a/linux/al2023/ug/kernel-update.md b/linux/al2023/ug/kernel-update.md
index e3a970ee2..963de96bc 100644
--- a//linux/al2023/ug/kernel-update.md
+++ b//linux/al2023/ug/kernel-update.md
@@ -124,17 +124,11 @@ You can in-place upgrade a running AL2023 instance to kernel 6.12 or 6.18 with t
-        $ declare -A pkgs
-    $ pkgs=(
-    [bpftool${SOURCE_VERSION}]=bpftool${TARGET_VERSION}
-    [kernel${SOURCE_VERSION}-debuginfo]=kernel${TARGET_VERSION}-debuginfo
-    [kernel${SOURCE_VERSION}-debuginfo-common]=kernel${TARGET_VERSION}-debuginfo-common
-    [kernel${SOURCE_VERSION}-headers]=kernel${TARGET_VERSION}-headers
-    [kernel${SOURCE_VERSION}-libbpf]=kernel${TARGET_VERSION}-libbpf
-    [kernel${SOURCE_VERSION}-libbpf-devel]=kernel${TARGET_VERSION}-libbpf-devel
-    [kernel${SOURCE_VERSION}-libbpf-static]=kernel${TARGET_VERSION}-libbpf-static
-    [kernel${SOURCE_VERSION}-modules-extra-common]=kernel${TARGET_VERSION}-modules-extra-common
-    [kernel${SOURCE_VERSION}-tools]=kernel${TARGET_VERSION}-tools
-    [kernel${SOURCE_VERSION}-tools-devel]=kernel${TARGET_VERSION}-tools-devel
-    [perf${SOURCE_VERSION}]=perf${TARGET_VERSION}
-    [python3-perf${SOURCE_VERSION}]=python3-perf${TARGET_VERSION}
-    )
-    $ for pkg in "${!pkgs[@]}"; do 
-      rpm -q $pkg && sudo dnf -y swap $pkg "${pkgs["$pkg"]}" ;
+        $ for pkg in bpftool kernel-debuginfo kernel-debuginfo-common kernel-headers \
+                kernel-modules-extra-common perf python3-perf; do
+      case "$pkg" in
+        kernel-*)
+          src="kernel${SOURCE_VERSION}${pkg#kernel}"
+          tgt="kernel${TARGET_VERSION}${pkg#kernel}" ;;
+        *)
+          src="${pkg}${SOURCE_VERSION}"
+          tgt="${pkg}${TARGET_VERSION}" ;;
+      esac
+      rpm -q "$src" && sudo dnf -y swap "$src" "$tgt"
@@ -142,0 +137,7 @@ You can in-place upgrade a running AL2023 instance to kernel 6.12 or 6.18 with t
+    # kernel-tools and kernel-tools-devel must be removed and reinstalled
+    # together due to version dependency requirements
+    $ if rpm -q "kernel${SOURCE_VERSION}-tools"; then
+      sudo dnf -y remove kernel${SOURCE_VERSION}-tools kernel${SOURCE_VERSION}-tools-devel
+      sudo dnf -y install kernel${TARGET_VERSION}-tools kernel${TARGET_VERSION}-tools-devel
+    fi
+              
@@ -178,17 +179,11 @@ If at any point in time you need to downgrade back to an earlier kernel version,
-        $ declare -A pkgs
-    $ pkgs=(
-    [bpftool${TARGET_VERSION}]=bpftool${SOURCE_VERSION}
-    [kernel${TARGET_VERSION}-debuginfo]=kernel${SOURCE_VERSION}-debuginfo
-    [kernel${TARGET_VERSION}-debuginfo-common]=kernel${SOURCE_VERSION}-debuginfo-common
-    [kernel${TARGET_VERSION}-headers]=kernel${SOURCE_VERSION}-headers
-    [kernel${TARGET_VERSION}-libbpf]=kernel${SOURCE_VERSION}-libbpf
-    [kernel${TARGET_VERSION}-libbpf-devel]=kernel${SOURCE_VERSION}-libbpf-devel
-    [kernel${TARGET_VERSION}-libbpf-static]=kernel${SOURCE_VERSION}-libbpf-static
-    [kernel${TARGET_VERSION}-modules-extra-common]=kernel${SOURCE_VERSION}-modules-extra-common
-    [kernel${TARGET_VERSION}-tools]=kernel${SOURCE_VERSION}-tools
-    [kernel${TARGET_VERSION}-tools-devel]=kernel${SOURCE_VERSION}-tools-devel
-    [perf${TARGET_VERSION}]=perf${SOURCE_VERSION}
-    [python3-perf${TARGET_VERSION}]=python3-perf${SOURCE_VERSION}
-    )
-    $ for pkg in "${!pkgs[@]}"; do 
-      rpm -q "${pkgs["$pkg"]}" && sudo dnf -y swap "${pkgs["$pkg"]}" $pkg ;
+        $ for pkg in bpftool kernel-debuginfo kernel-debuginfo-common kernel-headers \
+                kernel-modules-extra-common python3-perf; do
+      case "$pkg" in
+        kernel-*)
+          src="kernel${SOURCE_VERSION}${pkg#kernel}"
+          tgt="kernel${TARGET_VERSION}${pkg#kernel}" ;;
+        *)
+          src="${pkg}${SOURCE_VERSION}"
+          tgt="${pkg}${TARGET_VERSION}" ;;
+      esac
+      rpm -q "$src" && sudo dnf -y swap "$src" "$tgt"
@@ -196,0 +192,10 @@ If at any point in time you need to downgrade back to an earlier kernel version,
+    # perf requires --allowerasing due to libtraceevent conflicts
+    $ rpm -q "perf${SOURCE_VERSION}" && sudo dnf -y swap "perf${SOURCE_VERSION}" "perf${TARGET_VERSION}" --allowerasing
+    
+    # kernel-tools and kernel-tools-devel must be removed and reinstalled
+    # together due to version dependency requirements
+    $ if rpm -q "kernel${SOURCE_VERSION}-tools"; then
+      sudo dnf -y remove kernel${SOURCE_VERSION}-tools kernel${SOURCE_VERSION}-tools-devel
+      sudo dnf -y install kernel${TARGET_VERSION}-tools kernel${TARGET_VERSION}-tools-devel
+    fi
+