Ubuntu server 12.04 will not install packages

Posted on 2014-08-29
Last Modified: 2016-05-23
My problem started with a failed kernel update because the /boot partition was full. I have followed the many suggestions in google searches, most lately ran the following:

sudo apt-get clean
sudo apt-get update
sudo apt-get -f install

89 packages all failed. Webmin package updater produces the following snippet:

Building complete list of updates ..

Now updating apache2 ..

    Installing package(s) with command apt-get -y install apache2 ..

    dpkg: dependency problems prevent configuration of linux-generic:
     linux-generic depends on linux-image-generic (=; however:
      Version of linux-image-generic on system is
     linux-generic depends on linux-headers-generic (=; however:
      Version of linux-headers-generic on system is
    dpkg: error processing linux-generic (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
    Reading package lists...
    Building dependency tree...
    Reading state information...
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
     apache2 : Depends: apache2-mpm-worker (= 2.2.22-1ubuntu1.7) but it is not going to be installed or
                        apache2-mpm-prefork (= 2.2.22-1ubuntu1.7) but 2.2.22-1ubuntu1.5 is to be installed or
                        apache2-mpm-event (= 2.2.22-1ubuntu1.7) but it is not going to be installed or
                        apache2-mpm-itk (= 2.2.22-1ubuntu1.7) but it is not going to be installed
               Depends: apache2.2-common (= 2.2.22-1ubuntu1.7) but 2.2.22-1ubuntu1.5 is to be installed
     linux-generic : Depends: linux-image-generic (= but is to be installed
                     Depends: linux-headers-generic (= but is to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

    .. install failed!
Question by:RayRider
    LVL 34

    Expert Comment

    by:Seth Simmons
    ...because the /boot partition was full

    how big did you make it?
    LVL 5

    Expert Comment

    Manually remove the old kernel which is not required..
     And try updating the kernel and install the packages.

    Author Comment

    Seth Simmons:
    It was the size that was created from the install: 234295 1K blocks, used 189818 1K blocks, now 14% free.

    Please give me some details on manually removing the old kernels.
    How do I update the kernel and install the packages?
    What do I delete from the /boot directory?

    uname -a
    linux greece 3.2.0-67-generic #101-ubuntu SMP Tue Jul 15 17:46:11 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    Below is the directory list for /boot:

    rrider@greece:/boot$ ls -al
    total 185764
    drwxr-xr-x  4 root root     3072 Aug 29 18:58 .
    drwxr-xr-x 23 root root     4096 Aug 29 18:58 ..
    -rw-r--r--  1 root root   795751 Dec  3  2013 abi-3.2.0-58-generic
    -rw-r--r--  1 root root   795743 Feb 18  2014 abi-3.2.0-60-generic
    -rw-r--r--  1 root root   795743 May  2 17:17 abi-3.2.0-61-generic
    -rw-r--r--  1 root root   795911 May 15 18:44 abi-3.2.0-63-generic
    -rw-r--r--  1 root root   795911 Jun  4 17:30 abi-3.2.0-64-generic
    -rw-r--r--  1 root root   795911 Jun 11 15:52 abi-3.2.0-65-generic
    -rw-r--r--  1 root root   795963 Jul 15 13:11 abi-3.2.0-67-generic
    -rw-r--r--  1 root root   795963 Aug 12 17:27 abi-3.2.0-68-generic
    -rw-r--r--  1 root root   140629 Dec  3  2013 config-3.2.0-58-generic
    -rw-r--r--  1 root root   140612 Feb 18  2014 config-3.2.0-60-generic
    -rw-r--r--  1 root root   140612 May  2 17:17 config-3.2.0-61-generic
    -rw-r--r--  1 root root   140640 May 15 18:44 config-3.2.0-63-generic
    -rw-r--r--  1 root root   140640 Jun  4 17:30 config-3.2.0-64-generic
    -rw-r--r--  1 root root   140640 Jun 11 15:52 config-3.2.0-65-generic
    -rw-r--r--  1 root root   140641 Jul 15 13:11 config-3.2.0-67-generic
    -rw-r--r--  1 root root   140675 Aug 12 17:27 config-3.2.0-68-generic
    drwxr-xr-x  3 root root     5120 Aug 29 18:58 grub
    -rw-r--r--  1 root root 14815201 Feb  6  2014 initrd.img-3.2.0-58-generic
    -rw-r--r--  1 root root 14816583 Apr 23 06:35 initrd.img-3.2.0-60-generic
    -rw-r--r--  1 root root 14816455 May  6 06:46 initrd.img-3.2.0-61-generic
    -rw-r--r--  1 root root 14817596 May 26 06:53 initrd.img-3.2.0-63-generic
    -rw-r--r--  1 root root 14817743 Jun  6 06:51 initrd.img-3.2.0-64-generic
    -rw-r--r--  1 root root 14801206 Aug 10 16:48 initrd.img-3.2.0-65-generic
    -rw-r--r--  1 root root 14800933 Aug 10 16:48 initrd.img-3.2.0-67-generic
    -rw-r--r--  1 root root 14801302 Aug 29 18:58 initrd.img-3.2.0-68-generic
    drwxr-xr-x  2 root root    12288 Jul  7  2012 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  2895308 Dec  3  2013
    -rw-------  1 root root  2895229 Feb 18  2014
    -rw-------  1 root root  2895229 May  2 17:17
    -rw-------  1 root root  2896164 May 15 18:44
    -rw-------  1 root root  2896724 Jun  4 17:30
    -rw-------  1 root root  2896866 Jun 11 15:52
    -rw-------  1 root root  2896997 Jul 15 13:11
    -rw-------  1 root root  2897193 Aug 12 17:27
    -rw-------  1 root root  4983216 Dec  3  2013 vmlinuz-3.2.0-58-generic
    -rw-------  1 root root  4981616 Feb 18  2014 vmlinuz-3.2.0-60-generic
    -rw-------  1 root root  4982576 May  2 17:17 vmlinuz-3.2.0-61-generic
    -rw-------  1 root root  4985488 May 15 18:44 vmlinuz-3.2.0-63-generic
    -rw-------  1 root root  4986832 Jun  4 17:30 vmlinuz-3.2.0-64-generic
    -rw-------  1 root root  4986992 Jun 11 15:52 vmlinuz-3.2.0-65-generic
    -rw-------  1 root root  4986960 Jul 15 13:11 vmlinuz-3.2.0-67-generic
    -rw-------  1 root root  4988144 Aug 12 17:27 vmlinuz-3.2.0-68-generic

    Author Comment

    Another comment from looking at the update failure messages that are saying something to the effect of problems with dependencies. It is saying that the update depends on linux-image-generic (=; however, version of linux-image-generic on system is And, the same basic message with "headers".

    All of the 89 updates it is trying to do are depending on and I have installed.

    The question is how to make the update process stop asking WEBMIN to update all these packages on a system that is on a higher level of the kernel? I need to get that issue synced up somehow.

    Author Comment

    My question has been abandoned by everyone. Is there anyone available to assist me in solving this problem. There once was somewhere on Experts Exchange a method to request an adviser to elevate the problem, or to maybe include another category. There once was a system message that told me my question was "stagnant", and some advice on what to do, or just close it.

    Author Comment

    I've requested that this question be deleted for the following reason:

    Answer found on Google
    LVL 34

    Expert Comment

    by:Seth Simmons
    so explain what the answer is and select that

    Accepted Solution

    To satisfy any questions about this post and the reason I wish to delete it, The below steps are what I found to solve my issue when /boot is too full to allow updates:

    NOTE: this is only if you can't use apt to clean up due to a 100% full /boot
    If apt-get isn't functioning because your /boot is at 100%, you'll need to clean out /boot first. This likely has caught a kernel upgrade in a partial install which means apt has pretty much froze up entirely and will keep telling you to run apt-get -f install even though that command keeps failing.
    Get the list of kernel images and determine what you can do without: sudo dpkg --list 'linux-image*' The one current running kernel versiot can be found with: uname -r. Note the two newest versions in the list and the one in use.
    Craft a command to delete all files in /boot for kernels that don't matter to you using brace expansion to keep you sane. Remember to exclude the current and two newest kernel images. Example: sudo rm -rf /boot/*-3.2.0-{23,45,49,51,52,53,54,55}-*.
    sudo apt-get -f install to clean up what's making apt grumpy about a partial install.
    If you run into an error that includes a line like "Internal Error: Could not find image (/boot/vmlinuz-3.2.0-56-generic)", then run the command: sudo apt-get purge linux-image-3.2.0-56-generic (with your appropriate version).
    Finally: sudo apt-get autoremove to clear out the old kernel image packages that have been orphaned by the manual boot clean.
    Suggestion, run: sudo apt-get update and sudo apt-get upgrade to take care of any upgrades that may have backed up while waiting for you to discover the full /boot partition.
    Suggestion2, Review and consider setting Unattended-Upgrade::Remove-Unused-Dependencies to true in /etc/apt/apt.conf.d/50unattended-upgrades. This will be the equivalent of running autoremove after each security updates to be sure you clean out unused kernels but will also remove other things it thinks are unused saving you from this problem in the future.

    Author Closing Comment

    I found it from other sources

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now