Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 can use aptitude to search for packages using a search term. For example, to search for all packages whose name begins with Foo:

$ aptitude search Foo*

However, this listing does not include source packages (package with source code).

How do I search and list source packages using a search term?

share|improve this question
are you referring to ? – VRU Jan 30 '13 at 4:38

Searching: I don't know how to perform a regex search over source package names using apt on the target machine, but one can perform a regex search over source package names by selecting "Source package names" under "Search package directories" at

Listing: Once you know the source package name 'foo', apt-cache showsrc foo shows the source package records for foo.

share|improve this answer

this is what I do (besides what is listed) using unity as a example

apt-cache policy unity*

or This is a much larger list that shows you the control files of packages apt-cache show unity*

Or you can use 'dump' to dump everything (not recommended)

apt-cache dump unity*

Or you can use dpkg also like

dpkg-query -l | grep unity*

Or you could use

apt-cache showpkg unity*    

Hope this helps

share|improve this answer
For the penultimate line, dpkg -l | grep unity will do the job perfectly. :). No need to use dpkg-query. Besides, you must make sure to use correct regular expressions with grep: your unity* will also match on unit not followed by y, because you've just specified "unit" plus "letter y 0 to n times". Perhaps you actually intended to use unity.* instead. – syntaxerror Jun 4 '15 at 9:43

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.