清理 /boot 后安装最新内核

清理 /boot 后安装最新内核

我继承了一台服务器Ubuntu 16.04并且运行时间非常长,而且/boot在一个很小的独立分区中没有剩余空间。我安装的内核是:

ii  linux-image-4.4.0-116-generic       4.4.0-116.140                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-119-generic       4.4.0-119.143                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-121-generic       4.4.0-121.145                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-124-generic       4.4.0-124.148                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-127-generic       4.4.0-127.153                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-128-generic       4.4.0-128.154                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-130-generic       4.4.0-130.156                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-133-generic       4.4.0-133.159                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-4.4.0-134-generic       4.4.0-134.160                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-21-generic        4.4.0-21.37                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP

linux-image-4.4.0-116-generic我当前的内核uname -r

如图所示,所有安装的内核都比当前安装的内核新,因此我按照再次…/boot 已满 [重复],但运行后

dpkg --remove linux-image-4.4.0-{119,121,124,127,128,130,133}-generic linux-image-extra-4.4.0-{119,121,124,127,128,130,133}-generic

试图逃跑

sudo apt install --reinstall linux-image-generic linux-image-extra-generic

收到此错误

E: Unable to locate package linux-image-extra-generic

sudo apt-get autoremove没有作用并建议‘apt-get -f install’。

完成后尝试apt-get -f install再次安装所有先前删除的内核:

The following additional packages will be installed:
  linux-generic linux-headers-4.4.0-139 linux-headers-4.4.0-139-generic linux-headers-generic linux-image-4.4.0-119-generic
  linux-image-4.4.0-121-generic linux-image-4.4.0-124-generic linux-image-4.4.0-127-generic linux-image-4.4.0-128-generic linux-image-4.4.0-130-generic linux-image-4.4.0-133-generic linux-image-4.4.0-137-generic
  linux-image-4.4.0-139-generic linux-image-extra-4.4.0-139-generic linux-image-generic

我怎样才能只安装较新的内核版本而不安装中间的版本?

相关内容