2

I am using Ubuntu 12.04. I can't install or upgrade any package I have:

apt-get install traceroute
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-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

If I try -f, I'm told /boot is full:

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.2.0-74 linux-image-3.2.0-74-generic linux-headers-3.2.0-74-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-generic linux-headers-generic linux-image-3.2.0-121-generic linux-image-generic
Suggested packages:
  fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.2.0-121-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 1 newly installed, 0 to remove and 203 not upgraded.
10 not fully installed or removed.
Need to get 0 B/38.8 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
........
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./boot/vmlinuz-3.2.0-121-generic': 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.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

My /boot size:

/dev/sda1        92M   85M  1.9M  98% /boot

ls -ll
total 76775
-rw------- 1 root root  2884358 Apr 11  2012 System.map-3.2.0-23-generic
-rw------- 1 root root  2897962 Dec  9  2014 System.map-3.2.0-74-generic
-rw------- 1 root root  2898003 Dec 16  2014 System.map-3.2.0-75-generic
-rw------- 1 root root  2898466 Jan 13  2015 System.map-3.2.0-76-generic
-rw-r--r-- 1 root root   791023 Apr 11  2012 abi-3.2.0-23-generic
-rw-r--r-- 1 root root   796535 Dec  9  2014 abi-3.2.0-74-generic
-rw-r--r-- 1 root root   796535 Dec 16  2014 abi-3.2.0-75-generic
-rw-r--r-- 1 root root   796597 Jan 13  2015 abi-3.2.0-76-generic
-rw-r--r-- 1 root root   140279 Apr 11  2012 config-3.2.0-23-generic
-rw-r--r-- 1 root root   140790 Dec  9  2014 config-3.2.0-74-generic
-rw-r--r-- 1 root root   140790 Dec 16  2014 config-3.2.0-75-generic
-rw-r--r-- 1 root root   140790 Jan 13  2015 config-3.2.0-76-generic
drwxr-xr-x 3 root root     7168 Feb  1  2015 grub
-rw-r--r-- 1 root root 14177627 Apr  9  2014 initrd.img-3.2.0-23-generic
-rw-r--r-- 1 root root 14232258 Dec 11  2014 initrd.img-3.2.0-74-generic
-rw-r--r-- 1 root root 14233553 Feb  1  2015 initrd.img-3.2.0-75-generic
drwx------ 2 root root    12288 Nov 21  2013 lost+found
-rw-r--r-- 1 root root   176764 Nov 27  2011 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw------- 1 root root  4965840 Apr 11  2012 vmlinuz-3.2.0-23-generic
-rw------- 1 root root  4990768 Dec  9  2014 vmlinuz-3.2.0-74-generic
-rw------- 1 root root  4991088 Dec 16  2014 vmlinuz-3.2.0-75-generic
-rw------- 1 root root  4991856 Jan 13  2015 vmlinuz-3.2.0-76-generic

I tried the solution here and other purge old kernels solutions but I got the following error:

$ uname -r
3.2.0-75-generic

$dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-3.2.0-23-generic     3.2.0-23.36                         Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-74-generic     3.2.0-74.109                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-75-generic     3.2.0-75.110                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP

$ apt-get remove linux-image-3.2.0-74-generic 
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-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Any help please?

Edit:

I tried the solution here and removed old kernels manually, but now I get a different dependcy issue:

apt-get install -f
......

Generating grub.cfg ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.2.0-121-generic
Found initrd image: /boot/initrd.img-3.2.0-121-generic
Found linux image: /boot/vmlinuz-3.2.0-76-generic
Found initrd image: /boot/initrd.img-3.2.0-76-generic
Found linux image: /boot/vmlinuz-3.2.0-75-generic
Found initrd image: /boot/initrd.img-3.2.0-75-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-generic (3.2.0.121.136) ...
Setting up linux-headers-generic (3.2.0.121.136) ...
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

and current kernel is still "3.2.0-75-generic"

5
  • No, as that solution doesn't work with me as i mentioned in my post that i tried the removal solution but failed, Feb 15 '17 at 11:25
  • You have /boot too small. You can increase it too.
    – Pilot6
    Feb 15 '17 at 11:26
  • Unfortunately the server is cloud hosted on gogrid, that i can't control it on console to shrink another space and resize it, thats why i was trying to remove old kernels to spare spaces Feb 15 '17 at 11:35
  • @muru, thank you using that post i updated my question with updates, another error showed up Feb 15 '17 at 12:02
  • Yes, you have let the problem develop for a long time, and now your linux-image-generic metapackage is out of date. Reinstall the metapackage to fix.
    – user535733
    Feb 15 '17 at 15:18
2

I used this question as I couldn't install any package due to missing dependencies due to some improper kernel upgrade and my /boot was almost full, I had to remove old kernel releases manually and keep last one:

rm vmlinuz-3.2.0-xx-generic abi-3.2.0-xx-generic config-3.2.0-xx-generic initrd.img-3.2.0-xx-generic System.map-3.2.0-xx-generic

It is not a best practice solution to manually remove the files, but I was unable to use APT or dpkg.

Then I ran apt-get install -f to fix missing dependencies and completely install the new kernel, but then I got the error:

dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then so I switched to this question that had the same issue and tried to re-install the kernel:

apt-get install --reinstall linux-generic=3.2.0.121.136 -f

But i also got same issue,

So I tried using dpkg:

# ls /var/cache/apt/archives/linux-generic*
/var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb

# dpkg --install /var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb
(Reading database ... 860860 files and directories currently installed.)
Preparing to replace linux-generic 3.2.0.121.136 (using .../linux-generic_3.2.0.121.136_amd64.deb) ...
Unpacking replacement linux-generic ...
Setting up linux-generic (3.2.0.121.136) ...

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

And everything worked normally,

Thanks to every comment that lead me to combine all those posts together to solve my issue @Pilot6, @muru and @user535733

Not the answer you're looking for? Browse other questions tagged or ask your own question.