1

Question: I wanted to do dist-upgrade on my server this morning.
What I got is this:

apt-get dist-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.5.0-32-generic : Depends: linux-image-3.5.0-32-generic but it is not installed
 linux-image-generic : Depends: linux-image-3.5.0-32-generic but it is not installed
E: Unmet dependencies. Try using -f.

After that I tried to install linux-image-3.5.0-32-generic, and this is what happened:

apt-get install linux-image-3.5.0-32-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.5.0-22 linux-headers-3.5.0-22-generic linux-headers-3.5.0-23
  linux-headers-3.5.0-23-generic linux-headers-3.5.0-25
  linux-headers-3.5.0-25-generic linux-headers-3.5.0-26
  linux-headers-3.5.0-26-generic linux-headers-3.5.0-27
  linux-headers-3.5.0-27-generic linux-headers-3.5.0-28
  linux-headers-3.5.0-28-generic linux-headers-3.5.0-30
  linux-headers-3.5.0-30-generic
Use 'apt-get autoremove' to remove them.
Suggested packages:
  fdutils linux-doc-3.5.0 linux-source-3.5.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.5.0-32-generic
0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded.
8 not fully installed or removed.
Need to get 12.0 MB of archives.
After this operation, 32.7 MB of additional disk space will be used.
Get:1 http://ch.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-image-3.5.0-32-generic amd64 3.5.0-32.53 [12.0 MB]
Fetched 12.0 MB in 5s (2,307 kB/s)                       
(Reading database ... 316189 files and directories currently installed.)
Unpacking linux-image-3.5.0-32-generic (from .../linux-image-3.5.0-32-generic_3.5.0-32.53_amd64.deb) ...
Done.
dpkg: error processing /var/cache/apt/archives/linux-image-3.5.0-32-generic_3.5.0-32.53_amd64.deb (--unpack):
 cannot copy extracted data for './boot/System.map-3.5.0-32-generic' to '/boot/System.map-3.5.0-32-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.5.0-32-generic /boot/vmlinuz-3.5.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-32-generic /boot/vmlinuz-3.5.0-32-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.5.0-32-generic_3.5.0-32.53_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@zotac:~# 

I have 250 GB of space left, but the boot partition is 95% full.
But now I cannot use apt-get anymore, because it's stuck with that package it can't install.

Also, apt-get autoremove and apt-get clean don't help.

How can I reset apt so this error is gone ? So I can remove the old linux-images and install the new one ?

WitchCraft
  • 1,834

1 Answers1

0

Looks like you've got plenty of old kernels (headers/devel) installed which are filling the /boot partition.

Run dpkg -l | grep linux-image and check the list and identify the ones you don't want any more. Remove all that you don't want by running apt-get purge to remove those no longer needed kernels.

NOTE: Normally it's a good idea to keep at least 2 kernels in case 1 breaks and doesn't boot.

As you have more space on /boot now you can apt-get install linux-image-3.5.0-32-generic --reinstall to install the latest kernel for 12.10. If it is successful, you can run dist-upgrade.

Terry Wang
  • 9,775
  • are this files acctually used by linux current installation, or just installation files, which one can easily remove? – andilabs May 12 '15 at 10:55