Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a package lm-sensors automatically installed on my Ubuntu 10.04, but can't find packages, that depend on it:

$ 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 <ubuntu-devel-discuss@lists.ubuntu.com>
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

No installed dependencies of lm-sensors can be found. Why is it still here then?

One more question: how do I search for a pattern in ? form:

$ sudo aptitude search ?depends(lm-sensors)
bash: syntax error near unexpected token `('

what am I doing wrong here?

share|improve this question
up vote 3 down vote accepted

You need to quote or escape the final argument. Unquoted parentheses ( ... ) are used to run commands in a sub-shell. e.g.

aptitude search '?depends(lm-sensors)'


aptitude search \?depends\(lm-sensors\)

(the ? is a shell glob pattern and should be escaped too...but in this particular case, it would only make a practical difference if you happened to have a file called something like xdepends(lm-sensors) in the current directory when you ran the aptitude search)

BTW, aptitude search doesn't need root privs and can be run withoutsudo.

share|improve this answer
Thank you very much! Stupid mistake from my part. – Bob Sep 25 '12 at 22:28

Sorry, I'm being dumb. Automatic package survives not only if it is depended-on, but also, if it is predepended or recommended or, upon certain settings, even suggested:


The second part of question still remains:

How do I search for a pattern in ? form:

$ sudo aptitude search ?depends(lm-sensors)
bash: syntax error near unexpected token `('

what am I doing wrong here?

share|improve this answer
Put the ?depends text in single quotes, i.e. aptitude search '?depends(lm-sensors)'. Your shell tries to evaluate the expression but can't so it will print the error message. By putting the parameter in single quotes no shell expansion will happen. – Ulrich Dangel Sep 25 '12 at 22:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.