Ubuntu 14 无法更新或升级!

Ubuntu 14 无法更新或升级!

我在运行中遇到问题

sudo apt-get update && apt-get upgrade

运行之后,我得到了这个:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-image-extra-3.16.0-50-generic : Depends: linux-image-3.16.0-50-generic but it is not installed
 linux-image-extra-3.16.0-60-generic : Depends: linux-image-3.16.0-60-generic but it is not installed
 linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-60-generic but it is not installed
E: Unmet dependencies. Try using -f.

然后我运行:

sudo apt-get -f install

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.16.0-37 linux-headers-3.16.0-37-generic
  linux-headers-3.16.0-38 linux-headers-3.16.0-38-generic
  linux-headers-3.16.0-39 linux-headers-3.16.0-39-generic
  linux-headers-3.16.0-41 linux-headers-3.16.0-41-generic
  linux-headers-3.16.0-43 linux-headers-3.16.0-43-generic
  linux-headers-3.16.0-46 linux-headers-3.16.0-46-generic
  linux-headers-3.16.0-48 linux-headers-3.16.0-48-generic
  linux-image-3.16.0-37-generic linux-image-3.16.0-38-generic
  linux-image-3.16.0-39-generic linux-image-3.16.0-41-generic
  linux-image-3.16.0-43-generic linux-image-3.16.0-46-generic
  linux-image-3.16.0-48-generic linux-image-extra-3.16.0-37-generic
  linux-image-extra-3.16.0-38-generic linux-image-extra-3.16.0-39-generic
  linux-image-extra-3.16.0-41-generic linux-image-extra-3.16.0-43-generic
  linux-image-extra-3.16.0-46-generic linux-image-extra-3.16.0-48-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-image-3.16.0-48-generic linux-image-3.16.0-60-generic
Suggested packages:
  fdutils linux-lts-utopic-tools
The following NEW packages will be installed:
  linux-image-3.16.0-48-generic linux-image-3.16.0-60-generic
0 upgraded, 2 newly installed, 0 to remove and 123 not upgraded.
20 not fully installed or removed.
Need to get 0 B/32.3 MB of archives.
After this operation, 90.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 318398 files and directories currently installed.)
Preparing to unpack .../linux-image-3.16.0-60-generic_3.16.0-60.80~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-3.16.0-60-generic (3.16.0-60.80~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-60-generic_3.16.0-60.80~14.04.1_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.16.0-60-generic' to '/boot/vmlinuz-3.16.0-60-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-60-generic /boot/vmlinuz-3.16.0-60-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-60-generic /boot/vmlinuz-3.16.0-60-generic
Preparing to unpack .../linux-image-3.16.0-48-generic_3.16.0-48.64~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-3.16.0-48-generic (3.16.0-48.64~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-48-generic_3.16.0-48.64~14.04.1_amd64.deb (--unpack):
 cannot copy extracted data for './boot/System.map-3.16.0-48-generic' to '/boot/System.map-3.16.0-48-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-48-generic /boot/vmlinuz-3.16.0-48-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-48-generic /boot/vmlinuz-3.16.0-48-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.16.0-60-generic_3.16.0-60.80~14.04.1_amd64.deb
 /var/cache/apt/archives/linux-image-3.16.0-48-generic_3.16.0-48.64~14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我想我可能需要清除 /boot 中的旧内核,但它们都是 3.16.0-**:

abi-3.16.0-37-generic         initrd.img-3.16.0-60-generic
abi-3.16.0-38-generic         lost+found
abi-3.16.0-39-generic         memtest86+.bin
abi-3.16.0-41-generic         memtest86+.elf
abi-3.16.0-43-generic         memtest86+_multiboot.bin
abi-3.16.0-44-generic         System.map-3.16.0-37-generic
abi-3.16.0-45-generic         System.map-3.16.0-38-generic
abi-3.16.0-46-generic         System.map-3.16.0-39-generic
abi-3.16.0-48-generic         System.map-3.16.0-41-generic
abi-3.16.0-60-generic         System.map-3.16.0-43-generic
config-3.16.0-37-generic      System.map-3.16.0-44-generic
config-3.16.0-38-generic      System.map-3.16.0-45-generic
config-3.16.0-39-generic      System.map-3.16.0-46-generic
config-3.16.0-41-generic      System.map-3.16.0-48-generic
config-3.16.0-43-generic      System.map-3.16.0-60-generic
config-3.16.0-44-generic      vmlinuz-3.16.0-37-generic
config-3.16.0-45-generic      vmlinuz-3.16.0-38-generic
config-3.16.0-46-generic      vmlinuz-3.16.0-39-generic
config-3.16.0-48-generic      vmlinuz-3.16.0-41-generic
config-3.16.0-60-generic      vmlinuz-3.16.0-43-generic
grub                          vmlinuz-3.16.0-44-generic
initrd.img-3.16.0-41-generic  vmlinuz-3.16.0-45-generic
initrd.img-3.16.0-43-generic  vmlinuz-3.16.0-46-generic
initrd.img-3.16.0-44-generic  vmlinuz-3.16.0-48-generic
initrd.img-3.16.0-45-generic  vmlinuz-3.16.0-60-generic
initrd.img-3.16.0-46-generic

然后我跑了:

Uname -a

Linux XVM48 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

然后我跑了:

sudo apt-get autoremove

似乎什么都没起作用.....所以我读了其他帖子,他们说要删除旧内核,但我没有看到任何旧版本。另外,我考虑过扩展 /boot 分区,但我不确定这是否是个好主意。任何帮助都将不胜感激!

答案1

根据您的日志,您的 /boot 空间不足。通过以下方式查看 /boot 磁盘使用情况以及剩余空间:

root@ashu-700-430qe:/# du -c -s -h /boot
193M    /boot
193M    total

还可以通过以下方式清除旧的未使用的内核

sudo apt-get autoremove --purge

并手动安装内核

sudo purge-old-kernels

有关详细信息,请参阅

相关内容