我在 dpkg 中看到了以前卸载的过时软件包:
$ sudo dpkg -l *boost*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture
+++-=========================-=================-=================
un libboost1.42-dev <none> <none>
但是,我无法删除该条目。
$ sudo apt --purge remove libboost1.42-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libboost1.42-dev' is not installed, so not removed
$ sudo dpkg --purge libboost1.42-dev
dpkg: warning: ignoring request to remove libboost1.42-dev which isn't installed
运行 apt-cache 显示:
$ sudo apt-cache policy libboost1.42-dev
libboost1.42-dev:
Installed: (none)
Candidate: (none)
Version table:
答案1
un
第一列的表示unknown
和not installed
。
在你的特殊情况它的意思是:
Package libboost1.42-dev is not available, but is referred to by another package
为什么?原因如下:
$ sudo apt-get install libboost1.42-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libboost1.42-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
解决方案?没有解决方案,这是设计使然……
开始测试
$ sudo grep -r 'libboost1.42-dev' /var/lib/apt/*
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-i386_Packages:Conflicts: bjam, boost-build, libboost1.42-dev, libboost1.46-dev, libboost1.48-dev, libboost1.49-dev, libboost1.50-dev, libboost1.52-dev, libboost1.53-dev, libboost1.54-dev, libboost1.55-dev, libboost1.57-dev
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages:Conflicts: bjam, boost-build, libboost1.42-dev, libboost1.46-dev, libboost1.48-dev, libboost1.49-dev, libboost1.50-dev, libboost1.52-dev, libboost1.53-dev, libboost1.54-dev, libboost1.55-dev, libboost1.57-dev
“问题”在于这两个文件/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages
,/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages
让我们检查其中一个:/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages
搜索libboost1.42-dev
会给我们一个新的软件包libboost1.58-dev
。请注意冲突软件包的列表:
包裹:libboost1.58-dev 优先级:可选 部分:libdevel 安装大小:102966 维护者:Ubuntu 开发人员 原始维护者:Debian Boost 团队 架构:amd64 来源:boost1.58 版本:1.58.0+dfsg-3.1ubuntu1 依赖: libstdc++-4.8-dev | libstdc++-dev 建议:libboost1.58-doc、libboost-atomic1.58-dev、libboost-chrono1.58-dev、libboost-context1.58-dev、libboost-coroutine1.58-dev、libboost-date-time1.58-dev、libboost-exception1.58-dev、libboost-filesystem1.58-dev、libboost-graph1 .58-dev、libboost-graph-parallel1.58-dev、libboost-iostreams1.58-dev、libboost-locale1.58-dev、libboost-log1.58-dev、libboost-math1.58-dev、libboost-mpi1.58-dev、libboost-mpi-python1.58-dev、libboost-program-options1.58-dev、libboos t-python1.58-dev、libboost-random1.58-dev、libboost-regex1.58-dev、libboost-serialization1.58-dev、libboost-signals1.58-dev、libboost-system1.58-dev、libboost-test1.58-dev、libboost-thread1.58-dev、libboost-timer1.58-dev、libboost-w ave1.58-dev、libboost1.58-tools-dev、libmpfrc++-dev、libntl-dev 冲突:bjam,boost-build,libboost1.42-dev、libboost1.46-dev、libboost1.48-dev、libboost1.49-dev、libboost1.50-dev、libboost1.52-dev、libboost1.53-dev、libboost1.54-dev、libboost1.55-dev、libboost1.57-dev 文件名:pool/main/b/boost1.58/libboost1.58-dev_1.58.0+dfsg-3.1ubuntu1_amd64.deb 尺寸:6233784 MD5sum:867f4210133469ec03d6cf882a9b6ad3 SHA1:39647540966b1eea834dd86e47158e67cf0b2ed6 SHA256:bc427831ec16348cf81f0dd44c889d23d4e70c9fa0f1aadefff0fa77119875cf 描述:Boost C++ 库开发文件 多架构:相同 主页:http://www.boost.org/ 描述-md5:afccffe6a3ce49022d7832b028860029 错误:https://bugs.launchpad.net/ubuntu/+filebug 起源:Ubuntu 支持:9m 任务:ubuntu-sdk-libs-dev
这是解决方案或解释
该包libboost1.42-dev
不可用,请检查 的输出apt-cache policy libboost1.42-dev
,但在冲突包列表中的另一个包 引用了它libboost1.58-dev
,这就是为什么 的输出中出现此项的原因sudo dpkg -l *boost*
。
该软件包libboost1.58-dev
位于 Ubuntu 主存储库中,您可以可以删除此存储库以摆脱dpkg …
命令的输出。但这确实是个糟糕的想法。