My apt got messed up installing boost

匆匆过客 提交于 2019-12-05 02:18:31

Some commands are redundant, but for a good measure:

sudo apt-get --purge remove libboost-all-dev libboost-dev libboost-doc
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
sudo apt-get install libboost1.54-dev

Be slightly careful about apt-get clean - it clears the local repo of retrieved packages in /var/cache/apt/archives. You shouldn’t have stored anything there, nor any application, but just be aware that the cache will be gone.

I had the same issue just now. To solve it

  1. Download the libboost1.54-dev deb package from Ubuntu packages site
  2. Force overwrite conflicts by

    sudo dpkg -i --force-overwrite libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

  3. Then install packages which failed

    sudo apt-get install -f

  4. Remove boost 1.53 with

    sudo apt-get autoremove

this repo https://launchpad.net/~boost-latest/+archive/ubuntu/ppa contains all the versions of libboost and fixed it for me!

sudo add-apt-repository ppa:boost-latest/ppa sudo apt-get update

now you can install the version you desire, the latest at the time of writing is 1.55:

sudo apt-get install libboost1X.55-all-dev

I initially tried mockinterface's suggestion above and persevered through but still got the problem.

Eventually I checked the error was on the package: libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

So I ran: sudo dpkg -i --force-overwrite /var/cache/apt/archives/libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

I then ran apt-get update and apt-get upgrade and all was happy with the system again.

The apt-get upgrade is important as it sets up the various libraries again properly.

For me, it worked installing manually the packages that "are not going to be installed" (in this order):

sudo apt-get install libboost1.46-dev sudo apt-get install libboost-dev sudo apt-get install libboost-all-dev

The installation works fine, but I didn't test out if the package works yet.

I tried what @mockinterface was going for but with synaptic. Did complete removal wherever possible of anything mentioning boost and notated what was being killed (strangely enough, aptitude, among several) to reinstall later.

Then as @Igor R. suggested in a comment, built boost from source.

At that point /usr/local/lib/liboost*.so* was full of stuff, of I believe later vintage than the Debian/Ubuntu repository.

However it appears to be a massive undertaking to remove all of boost because libreoffice, compiz, and unity depend on libboost-date-time1.54.0, libboost-program-options1.46.1, and libboost-serialization1.46..

AidenX
sudo aptitude install libboost1.55-all-dev

This finally worked for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!