无法在 Linux 中升级或更新软件包

无法在 Linux 中升级或更新软件包

大家好,我尝试使用软件更新升级软件包

我收到错误消息

升级需要磁盘“/boot”上总共 64.9 M 的可用空间。请在“/boot”上至少释放 64.9 M 的额外磁盘空间。您可以使用“sudo apt autoremove”删除旧内核,也可以在 /etc/initramfs-tools/initramfs.conf 中设置 COMPRESS=xz 以减小 initramfs 的大小。

/boot这是我的分区上的文件列表

ls /boot
config-4.15.0-50-generic  config-4.4.0-159-generic      lost+found                    System.map-4.15.0-55-generic  vmlinuz-4.15.0-54-generic
config-4.15.0-51-generic  grub                          memtest86+.bin                System.map-4.15.0-58-generic  vmlinuz-4.15.0-55-generic
config-4.15.0-52-generic  initrd.img-4.15.0-50-generic  memtest86+.elf                System.map-4.4.0-150-generic  vmlinuz-4.4.0-151-generic
config-4.15.0-54-generic  initrd.img-4.15.0-51-generic  memtest86+_multiboot.bin      System.map-4.4.0-151-generic  vmlinuz-4.4.0-159-generic
config-4.15.0-55-generic  initrd.img-4.15.0-52-generic  System.map-4.15.0-50-generic  System.map-4.4.0-159-generic
config-4.15.0-58-generic  initrd.img-4.15.0-54-generic  System.map-4.15.0-51-generic  vmlinuz-4.15.0-50-generic
config-4.4.0-150-generic  initrd.img-4.15.0-55-generic  System.map-4.15.0-52-generic  vmlinuz-4.15.0-51-generic
config-4.4.0-151-generic  initrd.img-4.4.0-151-generic  System.map-4.15.0-54-generic  vmlinuz-4.15.0-52-generic

我该如何清理 中的文件夹/boot

---更新正文如下----

如果我按照说明操作sudo apt autoremove,我将收到以下消息。

sudo apt autoremove 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up uuid-runtime (2.27.1-6ubuntu3.8) ...
insserv: warning: script 'upsMonitor' missing LSB tags and overrides
insserv: There is a loop between service torque-scheduler and upsMonitor if stopped
insserv:  loop involving service upsMonitor at depth 2
insserv:  loop involving service torque-scheduler at depth 1
insserv: Stopping upsMonitor depends on torque-scheduler and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package uuid-runtime (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up linux-image-unsigned-4.4.0-159-generic (4.4.0-159.187) ...
Processing triggers for linux-image-unsigned-4.4.0-159-generic (4.4.0-159.187) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 4.4.0-159-generic

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
'make' -j16 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=4.4.0-159-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/4.4.0-159-generic/build LD=/usr/bin/ld.bfd modules.......(bad exit status: 2)
ERROR (dkms apport): binary package for nvidia-396: 396.37 not found
Error! Bad return status for module build on kernel: 4.4.0-159-generic (x86_64)
Consult /var/lib/dkms/nvidia-396/396.37/build/make.log for more information.
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-159-generic

gzip: stdout: No space left on device
E: mkinitramfs failure find 141 cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-159-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-unsigned-4.4.0-159-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 uuid-runtime
 linux-image-unsigned-4.4.0-159-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我无法删除旧内核sudo apt autoremove

相关内容