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?


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 http://packages.ubuntu.com

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


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

  • 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. Jun 4 '15 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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