我已将系统更新至 16.04 并安装了大量更新。
我的计算机上自 2013 年 11 月以来就安装了 1.54 版的 boost 库。今天我重建了一些代码,但它再也找不到 boost regex 库了。
因此我尝试更新到最新版本,但仍然收到此错误:
sudo apt-get install libboost-all-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libboost-all-dev
它确实似乎应该在存储库中。我最初没有以这种方式安装 boost,而是去了他们自己的网站,可能使用一些“wget”命令构建了它。(我可能会尝试这样做并获取他们的最新版本 1.61,而此处的打包版本是 1.58)。
不过,我想知道为什么上述方法不起作用。
注意:sudo aptitude install libboost
给我以下反馈:
> Couldn't find package "libboost". However, the following packages
> contain "libboost" in their name: libboost1.58-tools-dev
> libboost1.58-tools-dev:i386 libboost-program-options1.58.0
> libboost-program-options1.58.0:i386 libboost1.58-dbg
> libboost1.58-dbg:i386 libboost1.58-dev libboost1.58-dev:i386
> libboost1.58-doc libboost-date-time1.53.0 libboost1.54-doc
> libboost-filesystem1.58.0 libboost-filesystem1.58.0:i386
> libboost-date-time1.54.0 libboost-system1.53.0 libboost-system1.54.0
> libboost-date-time1.58.0 libboost-date-time1.58.0:i386
> libboost-thread1.58.0 libboost-thread1.58.0:i386 libboost-system1.58.0
> libboost-system1.58.0:i386 libboost-random1.58.0
> libboost-random1.58.0:i386 libboost-dbg libboost-dbg:i386 libboost-dev
> libboost-dev:i386 libboost-doc libboost-program-options-dev
> libboost-program-options-dev:i386 libboost-date-time1.49.0
> libboost-iostreams1.53.0 libboost-iostreams1.54.0
> libboost-iostreams1.58.0 libboost-iostreams1.58.0:i386
> libboost-regex1.58.0 libboost-regex1.58.0:i386
> libboost-program-options1.58-dev libboost-program-options1.58-dev:i386
> No packages will be installed, upgraded, or removed. 0 packages
> upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
我照做了sudo add-apt-repository universe
,但仍然找不到该包。
我可以一次安装一个库,但仍然想知道为什么它不存在这一页表明确实如此。
答案1
尝试添加存储库(http://packages.ubuntu.com/search?keywords=libboost-all-dev)
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libboost-all-dev
答案2
再来一次sudo apt-get update
,它就成功了。
可能该更新需要在 add-apt-repository universe 之后进行。
答案3
我遇到了类似的错误,这对我有用:
sudo apt --fix-broken install
之后我能够安装库并且一切正常。