- 0x0000007b
- 2차세계대전
- 3.20해킹
- 3d프린터
- 4대강
- 502 error
- 53빌딩
- 7840hs
- 88체육관 수영장
- ABI
- abortive close
- abortive shutdown
- AHCI
- aic8800d80 chipset
- akmods
- ALC1220
- alma linux
- alternatives
- AM4 메인보드
- AMD
- amd 7840hs
- amd 그래픽 게임용
- amd 내장 그래픽 최적화
- anonymous file
- API
- apple.com
- APT
- apt-get
- Armagnac
- Asrock
- Today / Yesterday
- /
- Total
Linux Programmer
Upgrade to Rocky Linux 10 (로키리눅스10 업그레이드) 본문
지난 7월 Rocky Linux 10이 출시되었다.[1] 하지만 로키리눅스는 오피셜한 업그레이드 방법을 제공하지 않기 때문에 약간 편법으로 업그레이드를 해야한다. 오리지널 레퍼런스는 reddit에 올라온 "RHEL 10 upgrade from 9.6"이다.[2] 하지만 원문에 몇 가지 자잘한 버그가 있어서 본인이 약간 수정했다. 그리고 자동화를 위해 bash script도 작성했다. 우선 오류를 수정한 원문을 요약, 정리하면 다음과 같다.
How to Upgrade Rocky Linux 9 to Rocky Linux 10
Note: All commands require root user privileges.
Step 0: Ensure you have root user access for all commands.
Step 1: Enable the fastestmirror=1 option. This setting directs new package installations to the fastest available mirror site, saving time during the upgrade process.
Step 2: Clear any versionlock settings if they exist. This is especially important if versionlock was used to prevent kernel or other critical component updates for service stability. The upgrade will fail if versionlock restrictions remain in place, so they must be removed.
Step 3: Install the Rocky Linux 10 packages on your system: rocky-gpg-keys, rocky-release, and rocky-repos.
Step 4: If the rocky-repos package maintains old repository files pointing to Rocky Linux 9's GPG keys, errors will occur. Find and overwrite any *.rpmnew files in the /etc/yum.repos.d/ directory.
Step 5: Install Rocky Linux 10 using the command: dnf distro-sync
Step 6: If you use the rpmfusion nonfree repository, the old EL9 version may remain on your system. Remove the outdated version and reinstall the Rocky Linux 10 version.
Step 6a: Reboot the system after completing Step 6.
Step 7: Re-enable the fastestmirror=1 option. This setting is removed during the reinstallation process and must be reconfigured.
Step 8: Clean all temporary files using: dnf clean all
Step 9: Remove any remaining EL9 (old version) files. Use the command: rpm -e $(rpm -qa | grep '.el9.') 2>&1 | grep 'is needed by' | awk '{print $1}' to identify packages with dependencies. For packages with unresolvable dependencies, verify if they can be updated; otherwise, force remove them.
Step 10: Rebuild the rpm database.
There are two bash scripts for automation, written below. If the first script completes successfully, reboot the system and then run the second script.
업그레이드 자동화 bash script
위 프로세스를 자동화 하는 bash 스크립트는 다음과 같다. 스크립트 파일은 2개이며 첫번째 스크립트가 성공하면 재부팅한 뒤에 두번째 스크립트를 실행하면 된다.

업그레이드 bash script 1
첫번째 스크립트는 Rocky Linux 9.x 에서 10.1로 업그레이드하는 스크립트이다. 본인이 작업하거나 서비스하는 서버, 컨설팅해주는 회사의 서버는 9.4와 9.6이었는데 해당 스크립트로 업그레이드에 성공하였다. 그래도 만일 실행 오류가 있다면 적절하게 AI에게 물어서 해결하도록 하면 될 것이다. 아마도 gemini, claude, copilot, chatGPT 등에 물어보면 아주 잘 대답해 줄 것이다. 참고로 docker-ce나 nvidia-driver의 업그레이드 문제는 뒤에 적어두었다.
이 스크립트는 최대한 안전 코드를 넣어서 root 유저가 아니면 실행이 안되고, Rocky Linux 버전도 확인해서 9.x가 아니라면 작동하지 않도록 해두었다. 만일 업그레이드를 이미 한 뒤에 재실행하면 버전 체킹 때문에 실행이 중지될 것이다.
#!/bin/bash
ROCKY_VER_SOURCE=9
ROCKY_VER=10.1
REPO_URL="https://mirror.kakao.com/linux/rocky/${ROCKY_VER}/BaseOS/x86_64/os/Packages/r/"
PKGS_FILENAME=(
rocky-gpg-keys-10.1-1.2.el10.noarch.rpm
rocky-release-10.1-1.2.el10.noarch.rpm
rocky-repos-10.1-1.2.el10.noarch.rpm
)
PKGS_URL=(
"${PKGS_FILENAME[@]/#/$REPO_URL}"
)
check_el10_packages() {
local installed_count=0
for pkg_file in "${PKGS_FILENAME[@]}"; do
# .rpm을 제거하여 패키지명 추출
local pkg_name="${pkg_file%.rpm}"
# rpm -q로 설치 여부 확인
if rpm -q "$pkg_name" > /dev/null 2>&1; then
((installed_count++))
fi
done
# 1개 이상 EL10 프로그램이 설치되어 있으면 return 0
if [ $installed_count -gt 0 ]; then
return 0
else
return 1
fi
}
echo "Before you proceeding with the upgrade tasks below, you must first perform an update and reboot."
echo "If you have already done so, press Enter. If you still need to update and reboot, press Control-C to stop."
echo "** To update and reboot as root, run the following command:"
echo ""
echo " dnf -y update && dnf clean all && reboot"
read
echo "[II-0] Checking user privilege level."
echo " This script requires root privileges. The script will exit with an error if run by a non-root user."
if [ $UID -ne 0 ]; then
echo "[EE] Insufficient privileges : You must be root"
exit 1
fi
echo "[II-1] Checking the distribution and version."
if [ ! -f /etc/rocky-release ]; then
echo "[EE-1] It dosen't seem to be Rocky Linux. Please check the /etc/os-release and /etc/rocky-release files."
echo "* Exit with error."
exit 1
fi
echo " Rocky Linux has been dectected."
# Resume 상황인지 판단한다. 특히 rock-repos 설치에서 GPG-Key로 에러가 발생하는 경우를 감지해서 버전 체킹을 건너뛰도록 한다.
check_el10_packages
if [ $? -ne 0 ]; then
# 첫 설치라면 현재 Rocky Linux version이 9.x인지 체킹을 한다.
echo " Now let me check if the distrobution versio is ${ROCKY_VER_SOURCE}.x."
DIST_VERSION=$(grep "^VERSION_ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"')
DIST_VERSION_MAJOR=$(echo $DIST_VERSION | cut -d'.' -f1)
if [ "$DIST_VERSION_MAJOR" = "${ROCKY_VER_SOURCE}" ]; then
echo " Rocky Linux ${ROCKY_VER_SOURCE}.x detected. Upgrade requirements are met."
else
echo "[EE-1] Your Rocky Linux version is not ${ROCKY_VER_SOURCE}.x (current: $DIST_VERSION)"
echo "* Exit with error."
exit 1
fi
else
echo " => Resuming - Skipping version checking."
fi
echo "[II-2] Checking dnf option : fastestmirror"
if ! grep -q '^fastestmirror=1' /etc/dnf/dnf.conf; then
set -e
dnf config-manager --setopt fastestmirror=1 --save
set +e
fi
echo "[II-3] Checking dnf versionlock setting"
if dnf list installed | grep dnf-plugin-versionlock; then
echo " => clear versionlock setting if needed"
set -e
dnf versionlock clear
set +e
else
echo " => This step can be skipped if you don't use the versionlock feature."
fi
echo "***************************************************************************"
echo "*** Warning: DO NOT STOP or TERMINATE THE PROCESS UNTIL IT IS COMPLETE. ***"
echo "***************************************************************************"
echo "[II-4] Install prerequisite packages before distro-sync to RockyLinux ${ROCKY_VER}"
echo " => ${PKGS_URL[@]}"
dnf -y install ${PKGS_URL[@]}
RESCODE=$?
if [ $RESCODE -ne 0 ]; then
echo "[EE-4] ERROR : dnf -y install ${PKGS_URL[@]}"
exit $RESCODE
fi
rm -rf /usr/share/redhat-logos
# rocky-repos가 EL9의 GPG-KEY를 가진 옛날 버전의 rocky.repo를 그대로 보존하고
# 새로운 rocky.repo (EL10용)을 rpmnew로 백업하는 문제를 해결하기 위해
# 파일을 찾아서 변경하는 단계를 추가하도록 한다.
echo " Rename /etc/yum.repos.d/*.repo.rpmnew to *.repo"
REPO_DIR="/etc/yum.repos.d"
# .rpmnew 파일이 존재하는지 확인
if ls $REPO_DIR/*.repo.rpmnew 1> /dev/null 2>&1; then
echo " Processing repository files in $REPO_DIR"
# .rpmnew 파일들을 찾아서 처리
for rpmnew_file in $REPO_DIR/*.repo.rpmnew; do
# 파일명에서 .rpmnew를 제거하여 기본 파일명 추출
base_file="${rpmnew_file%.rpmnew}"
repo_file="$base_file"
rpmold_file="$base_file.rpmold"
echo " * Repository file: $(basename $repo_file)"
# 기존 .repo 파일을 .rpmold로 변경
if [ -f "$repo_file" ]; then
mv "$repo_file" "$rpmold_file"
echo " * Backup: $(basename $repo_file) -> $(basename $rpmold_file)"
fi
# .rpmnew 파일을 .repo로 변경
if [ -f "$rpmnew_file" ]; then
mv "$rpmnew_file" "$repo_file"
echo " * Renamed: $(basename $rpmnew_file) -> $(basename $repo_file)"
fi
done
else
echo " ***** Skipped if no .rpmnew files found in ${REPO_DIR}. *****"
fi
echo "[II-5] DNF distro-sync to ${ROCKY_VER}"
set -e
dnf -y --disablerepo="*" --enablerepo=baseos --enablerepo=appstream --enablerepo=extras --releasever=${ROCKY_VER} --allowerasing --skip-broken --setopt=deltarpm=false distro-sync
set +e
echo "[II-6] Checking rpmfusion nonfree repository"
RPMFUSION_URL='https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-10.noarch.rpm'
PKGNAME_RPMFUSION_NONFREE=$(rpm -qa 'rpmfusion*' | grep nonfree)
if [ ! -z $PKGNAME_RPMFUSION_NONFREE ]; then
set -e
rpm -e --nodeps $PKGNAME_RPMFUSION_NONFREE && dnf -y install ${RPMFUSION_URL}
set +e
fi
echo "[Step1] Exit with success. The system needs to be rebooted."
echo ""
echo "If the graphical environmnt dose not work after reboot, please reinstall the dbus-daemon package."
echo "* To install the package as root, run the following the command:"
echo ""
echo " dnf -y install dbus-daemon"
첫번째 스크립트가 성공했다면 "[Step1] Exit with success. The system needs to be rebooted" 가 보일 것이다. 재부팅을 해주면 된다.
업그레이드 bash script 2
재부팅이 완료되면 uname -a 명령으로 커널 버전에 el10 이 포함되어있는지 확인하자. 그리고나서 2번째 bash script를 실행하자. 이 스크립트는 남아있는 el9 구버전 패키지들을 청소해주는 기능을 가지고 있다. 두번째 스크립트도 root 권한으로 실행해야 하며, non-root로 실행하거나 버전오류가 있다면 실행이 중지되는 안전 코드가 들어있다.
#!/bin/bash
export LANG=en_US.UTF-8
set -o pipefail
typeset -i n_retry
ROCKY_VER=10.1
echo "[II-0] Checking user privilege level."
echo " This script requires root privileges. The script will exit with an error if run by a non-root user."
if [ $UID -ne 0 ]; then
echo "[EE] Insufficient privileges: You must be root."
exit 1
fi
echo "[II-1] Checking the distribution and version."
DIST_VERSION=$(grep "^VERSION_ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"')
if [ "$DIST_VERSION" = "${ROCKY_VER}" ]; then
echo " Rocky Linux ${DIST_VERSION} detected"
else
echo "[EE-1] Your Rocky Linux version is not ${ROCKY_VER}.x (current: $DIST_VERSION)"
echo "* Exit with error."
exit 1
fi
echo "[II-2] Checking dnf option : fastestmirror"
if ! grep -q '^fastestmirror=1' /etc/dnf/dnf.conf; then
set -e
dnf config-manager --setopt fastestmirror=1 --save
set +e
fi
echo "[II-3] Clean all"
dnf clean all
printf "[II-4] Trying to remove all 'el9(Enterprise Linux 9)' packages...\n"
while true; do
let n_retry++
failed_deps_file=$(rpm -e $(rpm -qa | grep '.el9.') 2>&1 | grep 'is needed by' | awk '{print $1}' | head -n1)
rescode=$?
if [ $rescode -eq 0 ] || [ -z $failed_deps_file ]; then
printf " (%03d) Successfully removed all 'el9' packages.\n" $n_retry
break
fi
# 해당 파일을 제공하는 패키지 찾기 (pkg_fullname = version을 포함한 이름, pkg_nameonly = only name)
printf " (%03d) Checking dependency...\n" $n_retry
printf " (%03d) $failed_deps_file <= This file causes a dependency conflict during package removal.\n" $n_retry
pkg_fullname=$(rpm -qf $failed_deps_file)
pkg_nameonly=$(rpm -qf $failed_deps_file --queryformat "%{NAME}")
printf " (%03d) $pkg_fullname <= The pakcage containing the file ($failed_deps_file)\n" $n_retry
echo " => Attempting update the package(${pkg_nameonly}); if failed, will delete."
# dnf로 업데이트 시도 후 업데이트 되면 el9 패키지 삭제
dnf -y update $pkg_nameonly
rescode=$?
if [ $rescode -eq 0 ]; then
printf " (%03d) Updated $pkg_nameonly via dnf.\n" $n_retry
else
printf " (%03d) dnf failed; forcing package removal via rpm.\n" $n_retry
rpm -e --nodeps $pkg_fullname
fi
done
echo "[II-5] Update all"
dnf -y update
printf "[II-6] (%03d) REBUILD Package DB.\n" $n_retry
rpm --rebuilddb
echo "[Step2] Exit with success."
2번째 스크립트까지 실행이 완료되면 Rocky Linux 10.1로 업그레이드 완전히 되었을 것이다.
Rocky Linux 10 주의점
Rocky Linux 10에서 크게 변경된 점을 몇 가지 소개하도록 한다.
1) 터미널 소프트웨어 변경
X윈도의 터미널 기본 프로그램이 gnome-terminal에서 ptyxis로 변경되었다. 따라서 단축키로 gnome-terminal을 실행하는 경우에는 단축키를 수정해야만 한다. 또한 새창을 띄울 때는 ptyxis --new-windows; 로 옵션을 추가해서 명령해야 한다. 그렇지 않으면 기존 터미널 창이 있다면 새로운 창을 실행하지 않게 된다.
2) docker-ce 재설치
docker-ce를 사용중이라면 기존 패키지를 삭제 후 재설치가 필요하다. 기존 시스템에서 작동중이던 docker container나 image들은 docker-ce를 삭제해도 잠깐 중지되었다가 재실행될 뿐 사라지거나 하지는 않는다. docker-ce의 설치 방법은 공식 사이트의 RHEL 10 설치 부분을 참고하면 된다. [3] 하지만 이것도 귀찮은 분들을 위해 아래에 적어두도록 하겠다. 그냥 copy해서 root로 명령내리면 된다.
dnf -y remove docker-ce && dnf -y config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo && dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && systemctl enable --now docker
3) nvidia 드라이버 재설치
nvidia 드라이버를 사용하는 경우에는 약간의 수고를 해야 한다. 만일 cuda가 포함된 nvidia official driver의 경우에는 Rocky Linux 9.x의 경우 dnf module 기능을 사용했을텐데, 이 기능은 Rocky Linux 10에서 deprecated되었다. 따라서 nvidia module를 완전 제거한 뒤에 다시 설치해야 한다. 아래와 같이 명령해서 제거하고, 재설치한다.
먼저 dnf module list;로 설치된 모듈을 확인한다. 아래와 같이 nvidia-driver가 보인다면 module 설치된 경우이다.
# dnf module list
WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
Last metadata expiration check: 0:01:06 ago on Thu 27 Nov 2025 08:40:19 PM KST.
@modulefailsafe
Name Stream Profiles Summary
nvidia-driver latest-dkms [e] default [i], fm, ks Nvidia driver for latest-dkms branch
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
nvidia-driver module 삭제를 위해 아래와 같이 dnf module reset nvidia; 명령을 사용한다.
# dnf module reset nvidia-driver
WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
Last metadata expiration check: 0:03:41 ago on Thu 27 Nov 2025 08:40:19 PM KST.
Dependencies resolved.
=========================================================================================================
Package Architecture Version Repository Size
=========================================================================================================
Resetting modules:
nvidia-driver
Transaction Summary
=========================================================================================================
Is this ok [y/N]: y
Complete!
# dnf module list
WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
Last metadata expiration check: 0:03:49 ago on Thu 27 Nov 2025 08:40:19 PM KST.
.... 이제 dnf module list에 아무것도 나오지 않아야 한다 ....
설치된 구형 cuda 패키지도 삭제하기 위해 dnf -y remove '*nvidia*'; 명령을 실행해야 한다.
# dnf -y remove '*nvidia*'
Dependencies resolved.
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Removing:
libnvidia-container-tools x86_64 1.18.0-1 @cuda-rhel9-x86_64 108 k
libnvidia-container1 x86_64 1.18.0-1 @cuda-rhel9-x86_64 3.1 M
nvidia-container-toolkit x86_64 1.18.0-1 @cuda-rhel9-x86_64 4.4 M
nvidia-container-toolkit-base x86_64 1.18.0-1 @cuda-rhel9-x86_64 24 M
nvidia-gpu-firmware noarch 20251008-15.8.el10_0 @appstream 101 M
Transaction Summary
=========================================================================================================
Remove 5 Packages
...생략...
이제 epel-release (저장소)을 설치해주고, nvidia 저장소 추가후 nvidia-driver를 설치하면 된다. 명령어는 dnf -y install epel-release && dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel10/$(uname -m)/cuda-rhel10.repo && dnf -y install nvidia-driver; 이다.
# dnf -y install epel-release && dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel10/$(uname -m)/cuda-rhel10.repo && dnf -y install nvidia-driver;
Last metadata expiration check: 0:05:05 ago on Thu 27 Nov 2025 08:40:19 PM KST.
Dependencies resolved.
=========================================================================================================
Package Architecture Version Repository Size
=========================================================================================================
Installing:
nvidia-driver x86_64 3:580.105.08-1.el10 cuda-rhel10-x86_64 4.6 M
Installing dependencies:
cuda-driver-devel-13-0 x86_64 13.0.96-1 cuda-rhel10-x86_64 45 k
dkms noarch 3.3.0-1.el10_1 epel 89 k
egl-gbm x86_64 2:1.1.2.1-1.el10_1 epel 21 k
egl-wayland x86_64 1.1.20-2.el10_1 epel 45 k
egl-x11 x86_64 1.0.3-1.el10_1 epel 55 k
kernel-devel-matched x86_64 6.12.0-124.8.1.el10_1 appstream 1.4 M
kmod-nvidia-open-dkms noarch 3:580.105.08-1.el10 cuda-rhel10-x86_64 16 M
libglvnd-egl x86_64 1:1.7.0-7.el10 appstream 36 k
libglvnd-gles x86_64 1:1.7.0-7.el10 appstream 30 k
libglvnd-opengl x86_64 1:1.7.0-7.el10 appstream 38 k
libnvidia-gpucomp x86_64 3:580.105.08-1.el10 cuda-rhel10-x86_64 19 M
libnvidia-ml x86_64 3:580.105.08-1.el10 cuda-rhel10-x86_64 670 k
libvdpau x86_64 1.5-8.el10 appstream 17 k
libwayland-client x86_64 1.23.1-1.el10 appstream 33 k
mesa-libEGL x86_64 25.0.7-6.el10_1 appstream 131 k
mesa-vulkan-drivers x86_64 25.0.7-6.el10_1 appstream 17 M
nvidia-driver-libs x86_64 3:580.105.08-1.el10 cuda-rhel10-x86_64 144 M
nvidia-kmod-common noarch 3:580.105.08-1.el10 cuda-rhel10-x86_64 72 M
nvidia-modprobe x86_64 3:580.105.08-1.el10 cuda-rhel10-x86_64 30 k
vulkan-loader x86_64 1.4.313.0-1.el10 appstream 153 k
Transaction Summary
=========================================================================================================
Install 21 Packages
Total download size: 276 M
Installed size: 841 M
...생략...
간혹 gdm 화면 (로그인 화면)만 나오고 X 윈도 로그인이 제대로 작동하지 않는다면 dbus-daemon 문제가 대부분이므로 dnf -y install dbus-daemon; 명령으로 설치 해준다. 혹은 기존에 설치되어있다면 dnf -y reinstall dbus-daemon; 으로 재설치 해준다.
# dnf -y reinstall dbus-daemon
레퍼런스
[1] Rocky Linux 10.0 Available now, https://rockylinux.org/ko-KR/news/rocky-linux-10-0-ga-release
Rocky Linux 10.0 Available Now
Rocky Linux 10.0 Available Now By Neil Hanlon, Infrastructure Lead and Alexia Stein, Community Lead We are pleased to announce the general availabilit...
rockylinux.org
[2] RHEL10 upgrade from 9.6?, https://www.reddit.com/r/RockyLinux/comments/1l9gxdh/rhel_10_upgrade_from_96/
[3] Install Docker Engine on RHEL, https://docs.docker.com/engine/install/rhel/
'컴퓨터 관련 > 리눅스(유닉스) 일반' 카테고리의 다른 글
| 페도라42에서 docker 오류 (1) | 2025.08.14 |
|---|---|
| 리눅스 절전 모드 끄기 및 비활성화 systemd sleep 설정 (2) | 2025.03.21 |
| sudoers 및 PAM 보안 설정 - sudo, su 권한 조정 (0) | 2025.01.12 |
| 페도라 리눅스 DNF 저장소 설정 튜닝하기 - Fedora 41 dnf5 repository (2) | 2024.12.22 |
| 유닉스 표준 IEEE std 1003.1 issue 8 (SUSv5) 개정판 - 2024년 5월 발표 (4) | 2024.11.25 |
| 페도라 리눅스 nvidia 드라이버 설치 (RPM Fusion akmods, 24년 10월 기준) (4) | 2024.10.19 |
| 썬더볼트 장치 스캔 방법 - Fedora Linux / Windows (2) | 2024.02.26 |
| [CentOS7] vim 7.4의 python3 지원 (0) | 2022.11.23 |