Sign up ×

This question already has an answer here:

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

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?

share|improve this question

marked as duplicate by Danatela, Radu Rădeanu, Maythux, karel, Avinash Raj Apr 16 '14 at 11:38


1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
