apt-get autoremove 不接受正则表达式?

apt-get autoremove 不接受正则表达式?

运行apt-get install libboost.*1.40.0(Ubuntu 10.04.4)完美。

apt-get autoremove libboost.*1.40.0... 情况并非如此。有什么解决办法吗?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting libboost-system1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-python1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-signals1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-program-options1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-date-time1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-test1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-iostreams1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-wave1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-graph1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-thread1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-serialization1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-math1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-regex1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-filesystem1.40.0 for regex 'libboost.*1.40.0'
E: Couldn't find package libboost.*1.40.0

编辑:其实这与无关autoremove,甚至remove会做同样的事情

~# apt-get remove libboost-[a-z]*1.40.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note , selecting libboost-system1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-python1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-signals1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-test1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-iostreams1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-wave1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-graph1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-thread1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-serialization1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-math1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-regex1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-filesystem1.40.0 for regex 'libboost-[a-z]*1.40.0'
E: Couldn't find package libboost-[a-z]*1.40.0

答案1

作为一种解决方法,您可以运行dpkg -l|grep 'libboost.*1.40.0'|cut -d' ' -f3|xargs sudo apt-get remove --purge以将它们从系统中删除。

相关内容