LoginSignup
3
3

More than 5 years have passed since last update.

Ubuntuの古いカーネルイメージを削除する

Posted at

カーネルの更新と/boot

  • apt-getでカーネルを更新すると、古いバージョンのカーネルが残る場合がある。
    • /bootの領域を消費してしまう。

スクリプト

  • 現在利用中のバージョン以外のカーネルイメージを削除するシェルスクリプト。
v="$(uname -r | awk -F '-virtual' '{ print $1}')"
i="linux-headers-virtual|linux-image-virtual|linux-headers-${v}|linux-image-$(uname -r)"
sudo apt-get --purge remove $(dpkg --list | egrep -i  'linux-image|linux-headers' | awk '/ii/{ print $2}' | egrep -v "$i")

参考

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