I'm trying to do apt-get install -f -o APT::Immediate-Configure=0 (just apt-get install -f doesn't work currently for me...) which fails with

Unpacking libboost1.46-dev (from .../libboost1.46-dev_1.46.1-7ubuntu3_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libboost1.46-dev_1.46.1-7ubuntu3_i386.deb (--unpack):
 trying to overwrite '/usr/include/boost/aligned_storage.hpp', which is also in package libboost1.40-dev 1.40.0-4ubuntu4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

and many similar errors.

There are similar questions (1, 2) already but the suggested solution is for dpkg and I don't know how to apply that to apt-get.

How can I resolve this?


Well, I went with dpkg now but I tried to automate it a bit. My command looked like:

for f in $(sudo apt-get install python-gnupginterface -f | egrep "^ libboost" | cut -d: -f1); do echo $f; done | xargs sudo dpkg --purge

Then I did a dpkg --configure -a.

Then apt-get install -f.

Then apt-get autoremove.

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