![自动包已安装,但 aptitude 未找到任何依赖项。我究竟做错了什么?](https://linux22.com/image/25840/%E8%87%AA%E5%8A%A8%E5%8C%85%E5%B7%B2%E5%AE%89%E8%A3%85%EF%BC%8C%E4%BD%86%20aptitude%20%E6%9C%AA%E6%89%BE%E5%88%B0%E4%BB%BB%E4%BD%95%E4%BE%9D%E8%B5%96%E9%A1%B9%E3%80%82%E6%88%91%E7%A9%B6%E7%AB%9F%E5%81%9A%E9%94%99%E4%BA%86%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我在 Ubuntu 10.04 上自动安装了一个软件包lm-sensors
,但找不到依赖于它的软件包:
$ aptitude show lm-sensors
Package: lm-sensors
New: yes
State: installed
Automatically installed: yes
Version: 1:3.1.2-2
Priority: extra
Section: utils
Maintainer: Ubuntu Developers <[email protected]>
Uncompressed Size: 455k
Depends: sed (>= 4.0.5-1), lsb-base (>= 3.2-13), libc6 (>= 2.3.4), libsensors4
(>= 1:3.1.1), perl
Recommends: fancontrol
Suggests: sensord, read-edid, i2c-tools
Description: utilities to read temperature/voltage/fan sensors
Lm-sensors is a hardware health monitoring package for Linux. It allows you to
access information from temperature, voltage, and fan speed sensors. It works
with most newer systems.
This package contains programs to help you set up and read data from lm-sensors.
Homepage: http://www.lm-sensors.org
$ aptitude search ~Dlm-sensors
p ksensors - lm-sensors frontend for KDE
p sensord - hardware sensor information logging daemon
p wmgtemp - Temperature sensor dockapp for Window Make
p wmtemp - WM dock applet displaying lm_sensors tempe
找不到已安装的 lm-sensors 依赖项。那为什么它还在这里?
?
还有一个问题:如何在表单中搜索模式:
$ sudo aptitude search ?depends(lm-sensors)
bash: syntax error near unexpected token `('
我在这里做错了什么?
答案1
您需要引用或转义最后一个参数。不带引号的括号 ( ... ) 用于在子 shell 中运行命令。例如
aptitude search '?depends(lm-sensors)'
或者
aptitude search \?depends\(lm-sensors\)
(这是一个 shell glob 模式,也应该被转义...但在这种特殊情况下,只有当您运行 时碰巧在当前目录中?
碰巧有一个名为类似名称的文件时,才会产生实际差异)xdepends(lm-sensors)
aptitude search
顺便说一句,aptitude search
不需要 root 权限,并且可以在没有sudo
.
答案2
抱歉,我太笨了。自动包不仅在依赖时生存,而且在预先依赖或推荐或者在某些设置下甚至建议时也生存:
http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s02s07.html
问题的第二部分仍然存在:
如何在 中搜索模式?形式:
$ sudo aptitude search ?depends(lm-sensors)
bash: syntax error near unexpected token `('
我在这里做错了什么?