10

My battery died on an upgrade and now I have this problem when I try to install updates. How do I fix it?

The following packages have unmet dependencies:
linux-generic: Depends: linux-image-generic (= 3.2.0.52.62) but 3.2.0.57.68 is installed
Depends: linux-headers-generic (= 3.2.0.52.62) but 3.2.0.57.68 is installed
Avinash Raj
  • 78,556
user224338
  • 101
  • 1
  • 1
  • 3
  • Hi

    It is not working. I am seeing things along the lines of:

    dpkg: dependency problems prevent configuration of linux generic:

    and

    dpkg: error processing linux-generic (--configure):

    dependency problems leaving unconfigured

    – user224338 Dec 11 '13 at 12:54

4 Answers4

16

Fire this at command line:

 $ sudo apt-get install -f 

This checks your lib and if it finds unmet dependency, it'll fetch the needed files and install them.

Meanwhile - that dependency version of image-generic told me that you are running on 12.04. Perhaps this case will do the trick:

    $ sudo apt-get install syslinux-themes-debian-wheezy
    $ sudo apt-get upgrade && sudo apt-get dist-upgrade
    $ sudo dpkg-reconfigure -a
Faron
  • 1,398
  • 10
  • 14
  • Hi It is not working. I am seeing things along the lines of: dpkg: dependency problems prevent configuration of linux generic: and dpkg: error processing linux-generic (--configure): dependency problems leaving unconfigured – – user224338 Dec 11 '13 at 13:13
  • see my edit to reflect options – Faron Dec 11 '13 at 15:32
12

I just ran into this unmet dependencies problem while trying to do an "apt-get upgrade", but also had the additional issue of /boot having run out of space.

Some errors which provide clues that your /boot is out of space:

gzip: stdout: No space left on device

No apport report written because the error message indicates a disk full error

This meant that apt-get was helpless, with "sudo apt-get install -f" and "sudo apt-get autoremove" failing to work.

In the end, the link in Justin's answer provided the solution:

1) Check how many old linux-generic kernels you've got installed:

find /boot -type f -regex "^.*-generic"

2) If more than 2, manually clean out the old ones

sudo find /boot -type f -regex "^.*XX-generic" -delete

Replacing XX with the number of the old kernel you wish to remove (e.g. find /boot -type f -regex "^.*24-generic" -delete) Make sure you leave the latest two kernels (highest two numbers).

3) Now you've got space to fix the unmet dependencies:

sudo apt-get -f install
5

Removing and reinstalling linux-generic will solve this issue.To do this,try the below command on virtual console(ctrl+alt+F1)

sudo apt-get purge linux-generic    
sudo apt-get install --reinstall linux-generic
Avinash Raj
  • 78,556
4

I know this is a fairly old thread, but found a solution on another forum. The person suggested deleting all of the old kernel files as I ran into the same problem. It was because my /boot partition was full and therefore apt couldn't unpack and install anything. Here it is: How to handle out of space errors

Cheers, Justin

Justin
  • 41
  • 1
  • Hah! I know of that one, but rarely think about looking are my df /boot... I had to run apt-get autoremove --purge once to get things back in order (i.e. the following dist-upgrade still generated an error, but after that, all good!) – Alexis Wilke Apr 02 '17 at 07:08