我正在尝试卸载 boost 库:
sudo apt-get purge libbboost-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libbboost-dev
sudo apt-get purge libboost-all-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libboost-all-dev' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 219 not upgraded.
但是apt list --installed | grep boost
命令显示它仍然在这里。
WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts.
libboost-atomic1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-atomic1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-chrono1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-chrono1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-context1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-context1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-date-time1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-date-time1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-exception1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-filesystem1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-filesystem1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-graph-parallel1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-graph-parallel1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-graph1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-graph1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-iostreams1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-iostreams1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-locale1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-locale1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-math1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-math1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-mpi-python1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-mpi-python1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-mpi1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-mpi1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-program-options1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-program-options1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-python1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed]
libboost-python1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-random1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-random1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-regex1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-regex1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-serialization1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-serialization1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-signals1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-signals1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-system1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-system1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-test1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-test1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-thread1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed]
libboost-thread1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-timer1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-timer1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-wave1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost-wave1.54.0/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost1.54-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
libboost1.54-tools-dev/trusty-updates,now 1.54.0-4ubuntu3.1 amd64 [installed,automatic]
此命令不显示任何内容:
dpkg -L libboost-dev
dpkg-query: package 'libboost-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
还有一种方法:
ldconfig -p | grep boost
libboost_wserialization.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_wserialization.so.1.56.0
libboost_wserialization.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_wserialization.so.1.54.0
libboost_wserialization.so (libc6,x86-64) => /usr/local/lib/libboost_wserialization.so
libboost_wserialization.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_wserialization.so
libboost_wave.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_wave.so.1.56.0
libboost_wave.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_wave.so.1.54.0
libboost_wave.so (libc6,x86-64) => /usr/local/lib/libboost_wave.so
libboost_wave.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_wave.so
libboost_unit_test_framework.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_unit_test_framework.so.1.56.0
libboost_unit_test_framework.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0
libboost_unit_test_framework.so (libc6,x86-64) => /usr/local/lib/libboost_unit_test_framework.so
libboost_unit_test_framework.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so
libboost_timer.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_timer.so.1.56.0
libboost_timer.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_timer.so.1.54.0
libboost_timer.so (libc6,x86-64) => /usr/local/lib/libboost_timer.so
libboost_timer.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_timer.so
libboost_thread.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_thread.so.1.56.0
libboost_thread.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.54.0
libboost_thread.so (libc6,x86-64) => /usr/local/lib/libboost_thread.so
libboost_thread.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_thread.so
libboost_system.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_system.so.1.56.0
libboost_system.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0
libboost_system.so (libc6,x86-64) => /usr/local/lib/libboost_system.so
libboost_system.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_system.so
libboost_signals.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_signals.so.1.56.0
libboost_signals.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_signals.so.1.54.0
libboost_signals.so (libc6,x86-64) => /usr/local/lib/libboost_signals.so
libboost_signals.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_signals.so
libboost_serialization.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_serialization.so.1.56.0
libboost_serialization.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.54.0
libboost_serialization.so (libc6,x86-64) => /usr/local/lib/libboost_serialization.so
libboost_serialization.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_serialization.so
libboost_regex.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_regex.so.1.56.0
libboost_regex.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.54.0
libboost_regex.so (libc6,x86-64) => /usr/local/lib/libboost_regex.so
libboost_regex.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_regex.so
libboost_random.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_random.so.1.56.0
libboost_random.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_random.so.1.54.0
libboost_random.so (libc6,x86-64) => /usr/local/lib/libboost_random.so
libboost_random.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_random.so
libboost_python.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_python.so.1.56.0
libboost_python.so (libc6,x86-64) => /usr/local/lib/libboost_python.so
libboost_python-py34.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.54.0
libboost_python-py34.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python-py34.so
libboost_python-py27.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0
libboost_python-py27.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so
libboost_program_options.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_program_options.so.1.56.0
libboost_program_options.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.54.0
libboost_program_options.so (libc6,x86-64) => /usr/local/lib/libboost_program_options.so
libboost_program_options.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_program_options.so
libboost_prg_exec_monitor.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_prg_exec_monitor.so.1.56.0
libboost_prg_exec_monitor.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_prg_exec_monitor.so.1.54.0
libboost_prg_exec_monitor.so (libc6,x86-64) => /usr/local/lib/libboost_prg_exec_monitor.so
libboost_prg_exec_monitor.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_prg_exec_monitor.so
libboost_mpi_python-py34.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi_python-py34.so.1.54.0
libboost_mpi_python-py34.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi_python-py34.so
libboost_mpi_python-py27.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi_python-py27.so.1.54.0
libboost_mpi_python-py27.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi_python-py27.so
libboost_mpi.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi.so.1.54.0
libboost_mpi.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_mpi.so
libboost_math_tr1l.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_tr1l.so.1.56.0
libboost_math_tr1l.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1l.so.1.54.0
libboost_math_tr1l.so (libc6,x86-64) => /usr/local/lib/libboost_math_tr1l.so
libboost_math_tr1l.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1l.so
libboost_math_tr1f.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_tr1f.so.1.56.0
libboost_math_tr1f.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1f.so.1.54.0
libboost_math_tr1f.so (libc6,x86-64) => /usr/local/lib/libboost_math_tr1f.so
libboost_math_tr1f.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1f.so
libboost_math_tr1.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_tr1.so.1.56.0
libboost_math_tr1.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1.so.1.54.0
libboost_math_tr1.so (libc6,x86-64) => /usr/local/lib/libboost_math_tr1.so
libboost_math_tr1.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_tr1.so
libboost_math_c99l.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_c99l.so.1.56.0
libboost_math_c99l.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99l.so.1.54.0
libboost_math_c99l.so (libc6,x86-64) => /usr/local/lib/libboost_math_c99l.so
libboost_math_c99l.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99l.so
libboost_math_c99f.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_c99f.so.1.56.0
libboost_math_c99f.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99f.so.1.54.0
libboost_math_c99f.so (libc6,x86-64) => /usr/local/lib/libboost_math_c99f.so
libboost_math_c99f.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99f.so
libboost_math_c99.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_math_c99.so.1.56.0
libboost_math_c99.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99.so.1.54.0
libboost_math_c99.so (libc6,x86-64) => /usr/local/lib/libboost_math_c99.so
libboost_math_c99.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_math_c99.so
libboost_log_setup.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_log_setup.so.1.56.0
libboost_log_setup.so (libc6,x86-64) => /usr/local/lib/libboost_log_setup.so
libboost_log.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_log.so.1.56.0
libboost_log.so (libc6,x86-64) => /usr/local/lib/libboost_log.so
libboost_locale.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_locale.so.1.56.0
libboost_locale.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_locale.so.1.54.0
libboost_locale.so (libc6,x86-64) => /usr/local/lib/libboost_locale.so
libboost_locale.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_locale.so
libboost_iostreams.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_iostreams.so.1.56.0
libboost_iostreams.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.54.0
libboost_iostreams.so (libc6,x86-64) => /usr/local/lib/libboost_iostreams.so
libboost_iostreams.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_iostreams.so
libboost_graph_parallel.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_graph_parallel.so.1.54.0
libboost_graph_parallel.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_graph_parallel.so
libboost_graph.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_graph.so.1.56.0
libboost_graph.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_graph.so.1.54.0
libboost_graph.so (libc6,x86-64) => /usr/local/lib/libboost_graph.so
libboost_graph.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_graph.so
libboost_filesystem.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_filesystem.so.1.56.0
libboost_filesystem.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0
libboost_filesystem.so (libc6,x86-64) => /usr/local/lib/libboost_filesystem.so
libboost_filesystem.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so
libboost_date_time.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_date_time.so.1.56.0
libboost_date_time.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.54.0
libboost_date_time.so (libc6,x86-64) => /usr/local/lib/libboost_date_time.so
libboost_date_time.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_date_time.so
libboost_coroutine.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_coroutine.so.1.56.0
libboost_coroutine.so (libc6,x86-64) => /usr/local/lib/libboost_coroutine.so
libboost_context.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_context.so.1.56.0
libboost_context.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_context.so.1.54.0
libboost_context.so (libc6,x86-64) => /usr/local/lib/libboost_context.so
libboost_context.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_context.so
libboost_container.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_container.so.1.56.0
libboost_container.so (libc6,x86-64) => /usr/local/lib/libboost_container.so
libboost_chrono.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_chrono.so.1.56.0
libboost_chrono.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.54.0
libboost_chrono.so (libc6,x86-64) => /usr/local/lib/libboost_chrono.so
libboost_chrono.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_chrono.so
libboost_atomic.so.1.56.0 (libc6,x86-64) => /usr/local/lib/libboost_atomic.so.1.56.0
libboost_atomic.so.1.54.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.54.0
libboost_atomic.so (libc6,x86-64) => /usr/local/lib/libboost_atomic.so
libboost_atomic.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_atomic.so
我不记得 boost 是如何安装的,我的操作系统是 Ubuntu 14.04。
我的问题是:
应该使用什么方法来检测系统中是否存在库?
如何彻底删除boost库?
更新:
看来我成功地做到了这里,但不确定这是否是个好方法,并且apt list --installed | grep boost
仍然ldconfig -p | grep boost
显示出提升的存在:
rm /usr/local/lib/libboost*
sudo rm -r /usr/local/include/boost
答案1
服用时应加入 100 毫克氯化钠,因为一粒可能不够。我不是这方面的专家。以下建议值得考虑:
我会尝试再次安装它,然后清除它。可能不起作用,但我认为它不会造成伤害。如果失败了,您可以怀着忐忑不安的心情尝试编辑 /var/lib/dpkg/status。非常小心。在执行此操作之前进行备份,并确保有另一种启动方式来恢复备份,以防我引导您走上完全崩溃的系统之路。为了真正谨慎起见,请先使用 fsarchiver 备份系统。我经常这样做。请参阅此处的第 3 篇文章:
当 4.4.0-77 内核不断潜入并破坏我的系统时,该方法(加上手动更正 / 中的符号链接)对我有用。