Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Anytime I try to install python packages using the command:

sudo apt-get install python-package

I get the following output:

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-headers-generic : Depends: linux-headers-3.2.0-36-generic but it is not going to be installed
 linux-headers-generic-pae : Depends: linux-headers-3.2.0-36-generic-pae but it is not going to be installed
 linux-image-generic : Depends: linux-image-3.2.0-36-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

This seems to have started when these same three packages showed up in Ubuntu's Update Manager and kicked an error when I tried to install them there. Based on the suggestion in the output above, I tried running:

sudo apt-get -f install

But this only gave me several instances of the following error:

dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-36-generic_3.2.0-36.57_i386.deb (--unpack):
 unable to create `/lib/modules/3.2.0-36-generic/kernel/drivers/net/wireless/ath/carl9170/carl9170.ko.dpkg-new' (while processing `./lib/modules/3.2.0-36-generic/kernel/drivers/net/wireless/ath/carl9170/carl9170.ko'): No space left on device

Now maybe I'm way off-base here, but I'm wondering if the error could be coming from the "No space left on device" part? The thing is, I'm running Ubuntu as a VirtualBox VM but I've got it set to dynamically increase its virtual hard drive space as needed, so why am I still getting this error?

Here's my output when I use dh -f:

Filesystem        Size  Used Avail Use% Mounted on
/dev/sda1         6.9G  5.7G  869M  88% /
udev              494M  4.0K  494M   1% /dev
tmpfs             201M  784K  200M   1% /run
none              5.0M     0  5.0M   0% /run/lock
none              501M   76K  501M   1% /run/shm
VB_Shared_Folder  466G  271G  195G  59% /media/sf_VB_Shared_Folder

When I perform sudo apt-get -f install and the system says,

After this operation, 192 MB of additional disk space will be used.

Does that mean 192 MB of my virtual machine's current memory, or 192 MB on top of the rest of my free space? As I said, my machine normally dynamically allocates additional memory from the host machine, so I don't see why there would be memory restrictions at all...

share|improve this question
add comment

3 Answers 3

It's possible that the "No space left on device" error is related to the "unmet dependencies" problem. Either way, you have to fix both.

Check free space with any of these methods (such as df -h). If if you're low, free some up using these methods (removing old kernels; also applies when /boot is not a separate partition) and these methods (removing unused packages and cached package archives).

Especially if the "unmet dependencies" problem arose from software not being properly installed and configured after disk space ran out, you should be able to fix it simply:

sudo dpkg --configure -a
sudo apt-get update && sudo apt-get -f install

But if that doesn't work, don't fret--there are many other powerful (and easily applied) techniques for fixing "unmet dependencies":

share|improve this answer
    
Thank you for the answer. I've tried everything in your solution and on the page you linked me to, and I keep getting either E: Unmet dependencies. Try using -f. or E: Sub-process /usr/bin/dpkg returned an error code (1) or E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). –  GChorn Jan 31 '13 at 10:17
    
@GChorn So...what did you get from df -h? –  Eliah Kagan Jan 31 '13 at 12:45
    
In /dev/sda1, I have 869MB of space left. That should be enough right? –  GChorn Jan 31 '13 at 12:56
    
@GChorn That should be enough that low space on /dev/sda1 is not the cause of this problem, yes. There's other partitions though... can you edit your question to include the full output? –  Eliah Kagan Jan 31 '13 at 13:02
    
Done, see above, and thanks! –  GChorn Jan 31 '13 at 13:08
add comment

looks like virtualbox+apt= error

I am experiencing the same thing with ubuntu12.10 on virtalbox.
Most likely it's either an apt/dpkg error or virtualbox doesn't properly process something.

Maybe other pkg managers will work... you could try to use them; you could also install packages by downloading them from http://packages.ubuntu.com/

cd ~/downloads   
   dpkg -i *.deb  


share|improve this answer
    
Thanks for the answer. I tried this and got dpkg: error processing linux-headers-3.2.0-36_3.2.0-36.57_all.deb (--install): unable to create /usr/src/linux-headers-3.2.0-36/include/media/mt9p031.h.dpkg-new' (while processing ./usr/src/linux-headers-3.2.0-36/include/media/mt9p031.h'): No space left on device which is basically the same error as when I tried apt-get -f install... –  GChorn Jan 31 '13 at 15:00
add comment

If you install teamviewer, this can also happen. And the output may notify you that teamviewer's dependcy is unmet. In the first place, remove the software package teamviewer, and it will be all right then.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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