Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

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)'

or

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
add comment

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:

http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s02s07.html

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
1  
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
add comment

Your Answer

 
discard

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.