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 want to do something like

aptitude -P install mypackage*

which should install all packages which start with "mypackage". How can I do this with aptitude?

share|improve this question
I don't have the time to write up a proper answer right now, but you may find Searching for strings helpful. – Michael Kjörling May 20 '13 at 11:08
The * wildcard is a function of the shell, not of aptitude. You can configure your shell to expand the package list. – Marco May 20 '13 at 11:09
Try ~n to get that functionality. – schaiba May 20 '13 at 11:11
aptitude install '~n ^mypackage'

With multi-arch, you probably want to limit it to one architecture:

aptitude install '~n ^mypackage (~r amd64 | ~r all)'
share|improve this answer

This should do what you want:

aptitude search '^mypackage' | awk '{print $2}' | xargs aptitude install
share|improve this answer

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.