0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rocky Linuxでカーネルをアップデート時に/bootが足りなくなったら

0
Posted at

What's?

何気なくdnf upgradeした時にカーネルの更新があったのですが、こういうエラーになって失敗したのでその時の対処をメモしておきます。

エラー: トランザクションテストエラー:
  パッケージ kernel-core-6.12.0-211.34.1.el10_2.x86_64 のインストールには 30MB 以上の領域が /boot ファイルシステム上に必要です

環境

今回の環境はこちらです。

$ cat /etc/redhat-release
Rocky Linux release 10.2 (Red Quartz)


$ uname -srvmpio
Linux 6.12.0-211.28.1.el10_2.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 26 19:19:15 UTC 2026 x86_64 unknown unknown GNU/Linux

原因と対処

原因は文字通り/bootが足りないことです。

$ df -h | grep /boot$
/dev/vda3        936M  919M   18M   99% /boot

とはいえ、こういうエラーは初めて見たのでちょっと驚きました。

現時点で持っているカーネルは3つです。

$ rpm -q kernel-core
kernel-core-6.12.0-211.16.1.el10_2.0.1.x86_64
kernel-core-6.12.0-211.26.1.el10_2.x86_64
kernel-core-6.12.0-211.28.1.el10_2.x86_64

ここで、1番古いkernel-coreを削除します。

$ sudo dnf remove --oldinstallonly --setopt=installonly_limit=2 kernel-core

これで/bootに空きができたので、カーネルの更新ができるようになりました。

$ df -h | grep /boot$
/dev/vda3        936M  529M  408M   57% /boot

少しオプションの意味を見てみます。

--oldinstallonlyは、制限を超えたパッケージの削除です。

  --oldinstallonly      制限を超えた installonly パッケージを削除します

--setoptはリポジトリの設定です。

  --setopt SETOPTS      任意の設定オプションと repo オプションを設定します

これはyum.confの説明を見ることになります。

installonly_limit=2は保持するパッケージ数で、デフォルト値は3です。
これは実行中のカーネルの保護のためですね。動いているカーネルまで削除してしまうと困ったことになるので。

       installonly_limit
              integer

              Number of installonly packages allowed to be installed concurrently. Defaults to 3. The minimal number of installonly packages is 2. Value 0 means unlimited
              number of installonly packages. Value 1 is explicitly not allowed since it complicates kernel upgrades due to protection of the running kernel from removal.

というわけで、メモでした。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?