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.

I just recently bought an arduino and requires gcc-avr/avrdude to compile the software. I installed avr for another microprocessor component a while ago but is obviously an outdated version (gcc version 3.3 20030512 (prerelease)) so I went ahead to update these but it didn't work.

(Please note that before hand I also broke my aptdaemon through an incomplete wine installation (couldn't get passed font installation agreement) but I fixed that via a re-installation then accepting the agreement.)

I am trying to update these by running bingo's build script but the dependencies it requires cannot be installed due to avr... terminal reports

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
libncurses5-dev is already the newest version.
libncurses5-dev set to manually installed.
libusb-0.1-4 is already the newest version.
libx11-dev is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
arduino-core : Depends: gcc-avr but it is not going to be installed
avr-libc : Depends: gcc-avr (>= 1:4.3.4) but it is not going to be installed
Depends: binutils-avr (>= 2.20) but it is not going to be installed
binutils-dev : Depends: binutils (= 2.21.0.20110327-2ubuntu3) but 2.21.0.20110327-2ubuntu2 is to be installed
libcwidget-dev : Depends: libcwidget3 (= 0.5.16-3ubuntu2) but it is not going to be installed
Depends: libsigc++-2.0-dev but it is not going to be installed
Depends: libncursesw5-dev but it is not going to be installed
libmpfr-dev : Depends: libgmp3-dev (>= 4.2.dfsg-1) but it is not going to be installed
python-dev : Depends: python (= 2.7.1-0ubuntu5.1) but 2.7.1-0ubuntu5 is to be installed
Depends: python2.7-dev (>= 2.7.1-1~) but it is not going to be installed
tk8.4-dev : Depends: tk8.4 (= 8.4.19-4) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

But running

apt-get -f install

results in

(Reading database ... 163021 files and directories currently installed.)
Unpacking binutils-avr (from .../binutils-avr_2.20.1-1ubuntu2_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb (--unpack):
trying to overwrite '/usr/bin/avr-size', which is also in package avr-binutils 2.13.90.030512-2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking gcc-avr (from .../gcc-avr_1%3a4.3.5-1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb (--unpack):
trying to overwrite '/usr/bin/avr-g++', which is also in package avr-gcc-c++ 3.2.90.20030512-2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb
/var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried running update manager and updating my system via it but all I get is an error message

The following packages have unmet dependencies:
arduino-core: Depends: gcc-avr but it is not installed
avr-libc: Depends: gcc-avr (>= 1:4.3.4) but it is not installed
Depends: binutils-avr (>= 2.20) but it is not installed

which then tells me to try running apt-get -f install which just results the same as last time.

So how can I fix my system, I really need the new avr, please :) BTW, my system is Ubuntu 11.04

share|improve this question
    
Do you have synaptic installed in your system?! –  user61928 Oct 3 '12 at 10:17
    
Yes, why? I shouldn't have it? –  Omer Oct 3 '12 at 10:29
    
see the answer please –  user61928 Oct 3 '12 at 10:39
add comment

6 Answers

This usually happens as a result of 'Unmet dependencies for installed packages'.

Here's a simple solution if you have 'Synaptic' installed:

  • Open Synaptic.
  • Go To 'Status' (in the left navigation).
  • Choose 'Broken'.
  • Remove these broken packages.

Otherwise it can be dealt via CLI:

Open terminal and run this command:

sudo apt-get clean

Above command will clean out the local repository of retrieved package file.

sudo apt-get install -f

Will correct broken dependencies i.e. -f here stands for “fix broken”.

sudo dpkg --configure -a

will configure all (-a) the packages which haven't been configured yet. In the end do run the update command sudo apt-get update.

share|improve this answer
add comment

Open synaptic Install synaptic. Then go to status and choose Broken. Then remove completely the broken packages.

This should correct your system.

enter image description here

share|improve this answer
add comment

Had the same problem, an

sudo apt-get clean

followed by an

sudo apt-get update

followed by an

sudo apt-get upgrade -f

fixed it. I hope this helps!

share|improve this answer
add comment

If you're not already, try changing your package repository reference to 'Main' or the United States. Doing this fixed my Python-dev unmet-dependencies problem (my 12.04 install was using the United Kingdom package repository, previously).

  1. In 'Ubuntu Software Center' (USC) go to the menu/tab 'Edit => Software Sources'.
  2. Change the 'Download from' drop-down value to 'Main Server' or a server in the United States.
  3. Leave USC, the open 'Update Manager' from Ubuntu's program menu, and 'Check' for software update (or issue 'sudo apt-get update' in a terminal window).
  4. Update your software as you normally would, e.g. via 'Update Manager' or apt-get/aptitude in a terminal.

This repaired my repository and I went on to install whatever I needed afterwards, as normal.

Before rectifying my problem with the above instructions, various aptitude/apt-get commands suggested that I remove many, many packages, but, as you can apreciate, I didn't fancy loosing my 6-months+ of package additions, and that's even though I snapshot the package list at times (see my gist for hints)! I'm really glad I found out about the instructions I'm leaving here.

Hope this helps.

share|improve this answer
add comment

Try: sudo apt-get update && sudo apt-get -f install
I hope that this will resolve the issue.

share|improve this answer
    
Didn't resolve for me. –  Damien Roche Aug 7 '13 at 11:45
add comment

After you get that error, try sudo apt-get -f install to force an install of the files that didn't get loaded because of the error.

Then try sudo apt-get update again, sudo apt-get -f install back and forth until only the package that has the error is left.

sudo dpkg --configure -a

and clean the cache

sudo apt-get clean

share|improve this answer
    
Thanks for the answer, but I found a solution just as you posted this :P I opened synaptic package manager and filtered out two broken packages which I then removed with SPM, which now everything runs sweet and smooth. Managed to install the dependencies and I am now installing avr using bingo's script! :) It's not finished yet but if it fails I will try your answer –  Vigi Apr 4 '12 at 2:48
    
good to hear its fixed –  Ringtail Apr 4 '12 at 2:50
    
ok, Just deleted 11.04 partition and fresh installed 11.10. now running it alongside windows vista. So now I have the latest avr/binutils/libs etc installed. So I can now compile things for arduino :) yay! –  Vigi Apr 5 '12 at 4:16
add comment

protected by Community Jan 27 at 9:30

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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