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.

After installing some packages and libraries I have an error on Package Manager, I can't run any update because it says:

The package system is broken If you are using third party repositories then disable them, since they are a common source of problems. Now run the following command in a terminal: apt-get install -f

I've tried to do what it says and it returns me:

jara@jara-Aspire-5738:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libcaca-dev libopencv2.3-bin nite-dev python-bluez ps-engine libslang2-dev
python-sphinx ros-electric-geometry-tutorials
ros-electric-geometry-visualization python-matplotlib libzzip-dev
ros-electric-orocos-kinematics-dynamics ros-electric-physics-ode
libbluetooth-dev libaudiofile-dev libassimp2 libnetpbm10-dev
ros-electric-laser-pipeline python-epydoc ros-electric-geometry-experimental
libasound2-dev evtest python-matplotlib-data libyaml-dev ros-electric-bullet
ros-electric-executive-smach ros-electric-documentation libgl2ps0
libncurses5-dev ros-electric-robot-model texlive-fonts-recommended
python-lxml libwxgtk2.8-dev daemontools libxxf86vm-dev libqhull-dev
libavahi-client-dev ros-electric-geometry libgl2ps-dev libcurl4-openssl-dev
assimp-dev libusb-1.0-0-dev libopencv2.3 ros-electric-diagnostics-monitors
libsdl1.2-dev libjs-underscore libsdl-image1.2 tipa libusb-dev libtinfo-dev
python-tz python-sip libfltk1.1 libesd0 libfreeimage-dev
ros-electric-visualization x11proto-xf86vidmode-dev python-docutils
libvtk5.6 ros-electric-assimp x11proto-scrnsaver-dev libnetcdf-dev
libidn11-dev libeigen3-dev joystick libhdf5-serial-1.8.4
ros-electric-joystick-drivers texlive-fonts-recommended-doc esound-common
libesd0-dev tcl8.5-dev ros-electric-multimaster-experimental ros-electric-rx
libaudio-dev ros-electric-ros-tutorials libwxbase2.8-dev
ros-electric-visualization-common python-sip-dev
ros-electric-visualization-tutorials libfltk1.1-dev libpulse-dev libnetpbm10
python-markupsafe openni-dev tk8.5-dev wx2.8-headers freeglut3-dev
libavahi-common-dev python-roman python-jinja2
ros-electric-robot-model-visualization libxss-dev libqhull5 libaa1-dev
ros-electric-eigen freeglut3 ros-electric-executive-smach-visualization
ros-electric-common-tutorials ros-electric-robot-model-tutorials libnetcdf6
libjs-sphinxdoc python-pyparsing libaudiofile0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libcv-dev
The following NEW packages will be installed
libcv-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,114 kB of archives.
After this operation, 11.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 261801 files and directories currently installed.)
Unpacking libcv-dev (from .../libcv-dev_2.1.0-7build1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb 
(--           unpack):
trying to overwrite '/usr/bin/opencv_haartraining', which is also in package
libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried everything people recommend on internet like:

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

Also I've tried to install the synaptic manager but it doesn't let me install anything..

As you can see nothing works so I'm desperate!

I'm using ubuntu 11.10, 64 bits

Thanks!!

share|improve this question
add comment

4 Answers 4

http://www.iasptk.com/ubuntu-fix-broken-package-best-solution

After trying

sudo dpkg --configure -a

and

sudo apt-get install -f

the problem of a broken package still exist the solution is to edit the dpkg status file manually.

sudo nano /var/lib/dpkg/status  

(you can use vim instead of nano)

Locate the corrupt package, and remove the whole block of information about it and save the file.

share|improve this answer
    
Editing the status file was the solution! Thank you so much! :D –  delha Oct 4 '12 at 8:38
    
Same here, got it fixed by editing the status file. +1 –  AnPel Jan 6 '13 at 10:57
    
Thanks! I managed to fix that problem too. +1 –  Stasel Apr 12 '13 at 13:03
1  
Sorry, this is the wrong thing to do. Downvoting. –  Faheem Mitha Jun 27 at 21:49
2  
Doing this blindly will more surely cause problems. Yeah, it can fix some very specific cases but there are better alternatives like this other answer. –  Braiam Jun 27 at 21:53
show 3 more comments

Command op tried:

sudo apt-get install -f

Error report for the above command:

dpkg: error processing /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/opencv_haartraining', which is also in package
libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

From the above error report it was clearly shown that, while running sudo apt-get install -f command dpkg tries to extract and install /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb file.Installation requires to place opencv_haartraining file on the /usr/bin directory.

But it was shocked on seeing the same /usr/bin/opencv_haartraining file on the /usr/bin directory and produces the error.Because this file was already placed during libopencv2.3-bin package installation.

Solution for the above error is to remove the already installed libopencv2.3-bin package by running,

sudo dpkg -P libopencv2.3-bin

And then do,

sudo apt-get install -f

Now the above command automatically tries to install /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb package and it would install the package successfully because now there was no block.

share|improve this answer
add comment

first remove the libcv-dev package

sudo dpkg -r libcv-dev

then

sudo apt-get install -f

the

sudo apt-get update
share|improve this answer
1  
it kept giving an error but i've tried the other answer and it worked. Thank you a lot anyway!! –  delha Oct 4 '12 at 8:38
add comment

Replace the /var/lib/dpkg/status files with the same file from another working system running the same OS version. This worked for me.

share|improve this answer
1  
Can you clarify what you mean? –  Mark Paskal Oct 19 '12 at 9:15
add comment

protected by Community Feb 13 '13 at 13:55

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.