apt-get upgrade というコマンドは、「今入っているパッケージのバージョンを上げる」ことだけを行い、「新しいパッケージを追加したり、古いものを削除したりする」権限を持っていません。
今回の linux-image-... のようなカーネル(OSの中核)の更新は、単純な上書きではなく、「新しいバージョンのカーネルを新規インストールする」という挙動になります。
つまり、システムを勝手に壊さないための慎重な挙動です。
はい、アップデートを適用することをお勧めします。 表示されている linux-headers や linux-image はセキュリティ修正を含むOSの更新であることが多いため、放置せず適用するのが一般的です。
保留されたパッケージをインストールするには、以下の2つの方法のどちらかを実行してください。
このコマンドは、必要に応じてパッケージの新規追加や削除を許可し、全体を最新にします。
Bash
sudo apt-get dist-upgrade
※ 最近のDebian/Ubuntuでは sudo apt full-upgrade と書くことも多いですが、同じ意味です。
保留されているパッケージ名を直接指定してインストールすると、依存関係を解決してくれます。
Bash
sudo apt-get install linux-generic linux-image-virtual
(※主要なものを指定すれば、依存関係にある他も一緒に更新されます)
カーネル(linux-image-virtual など)が更新された場合、その変更をシステムに適用するには、OSの再起動が必要になります。
アップデート完了後、都合の良いタイミングで以下のコマンドを実行してください。
Bash
sudo reboot
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
linux-headers-6.8.0-79 linux-headers-6.8.0-79-generic
linux-image-6.8.0-79-generic linux-modules-6.8.0-79-generic
linux-tools-6.8.0-79 linux-tools-6.8.0-79-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
もう必要ないから、sudo apt autoremove で、これらを削除したらいいよ!って出てます。
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
linux-headers-6.8.0-79 linux-headers-6.8.0-79-generic
linux-image-6.8.0-79-generic linux-modules-6.8.0-79-generic
linux-tools-6.8.0-79 linux-tools-6.8.0-79-generic
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 189 MB disk space will be freed.
Do you want to continue? [Y/n]
これできれいさっぱりです。
sudo apt-get dist-upgrade を実行し、その後 sudo reboot する。これで最新かつ安全な状態でサーバーを利用できます。