How to install all packages whitch aptitude found?

For example:

sudo aptitude search eclipse

... found approximately 66 packages. How I can install all found packages without write separately?


You can use the * symbol as a wildcard. I know it works when deleting files that may all be titled the same but have different dates attached to the file name.

In your case, you would type:

sudo apt-get install eclipse*

This will install all packages that start with the string eclipse


sudo apt-get install eclipse

This will only install packages name "eclipse"

  • From the command-line, you should quote "eclipse*" if you intend passing it to apt-get as a pattern rather than expand it on the shell. – Thomas Dickey Nov 1 '15 at 23:49

I'd do something like this:

sudo apt-get -d -u install $(apt-cache search -n eclipse | cut -f1 -d' ' | grep -vE 'redeclipse|^lib')

Note the -d for --download-only. When you've made sure that it will install only what you want/need, remove the -d from the apt-get command.

apt-cache search -n's output is far less "noisy" than aptitude search's, so is easier to work with in a pipeline.

redeclipse is a game, not part of eclipse. And you want libs to be pulled in as a dependancy so they're marked as auto-installed. You can add any other packages you don't want installed to the grep -vE argument.

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.