90

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

4
  • Do you have synaptic installed in your system?!
    – user61928
    Oct 3, 2012 at 10:17
  • Yes, why? I shouldn't have it?
    – Omer
    Oct 3, 2012 at 10:29
  • Same error (but based on libboost). None of the answers worked for me. Oct 21, 2014 at 20:41
  • 1
    The command sudo apt --fix-broken install fixed it for me. Oct 28, 2021 at 13:14

7 Answers 7

88

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

7
  • 4
    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, 2012 at 2:48
  • good to hear its fixed
    – Ringtail
    Apr 4, 2012 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, 2012 at 4:16
  • As a result of this problem, I also failed to load mouse drivers and WLAN drivers. That means I have no more internet connection and can't use sudo apt-get -f install. Sep 15, 2015 at 9:39
  • 1
    not working.... everytime i get same error E: Sub-process /usr/bin/dpkg returned an error code (1) Jun 3, 2020 at 18:08
32

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.

5
  • As a result of this problem, I also failed to load mouse drivers and WLAN drivers. That means I have no more internet connection and can't use sudo apt-get -f install. Sep 15, 2015 at 9:39
  • You can use an offline/portable package manger i.e Keryx or Cube - help you download packages and latest repositories (in a folder or directly to pendrive) from some other computer with the internet connection (Linux or Windows), once done plug the pendrive to the computer w/o internet connection, and install the downloaded packages. Sep 16, 2015 at 10:40
  • A step-by-step tutorial for using Cube (haven't used it myself) - community.linuxmint.com/tutorial/view/1583 Sep 16, 2015 at 10:41
  • Another askubuntu answer with step-by-step Keryx setup - askubuntu.com/a/181913/58950 Sep 16, 2015 at 10:45
  • I was able to resolve just using sudo apt-get install -f and sudo dpkg --configure -a.. after a reboot I got back network, audio and so on :)
    – Luke
    Mar 30, 2017 at 1:54
19

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

1
  • I'm on Ubuntu 12.04. As soon as I opened Synaptics Software Center, it said the catalog was broken and must be repaired, and offered me a repair button, which cleared up the problem right away. Jan 19, 2015 at 21:33
7

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!

1
  • 1
    As a result of this problem, I also failed to load mouse drivers and WLAN drivers. That means I have no more internet connection and can't use sudo apt-get -f install. Sep 15, 2015 at 9:40
4

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

2
  • 2
    Didn't resolve for me.
    – Damien
    Aug 7, 2013 at 11:45
  • As a result of this problem, I also failed to load mouse drivers and WLAN drivers. That means I have no more internet connection and can't use sudo apt-get -f install. Sep 15, 2015 at 9:39
2

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.

0

This problem may be caused by thunderbird

try:

sudo apt-get remove  thunderbird

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .