7

I installed a few packages with APT using apt-get. I used the --no-install-recommends switch with it to save some disk space.

Now I need to know: how do I install the recommended packages for the already installed programs?

4
  • 1
    Aptitude has a view in its graphical interface listing all packages which are recommended by any installed package. To reach it, install aptitude, then type aptitude in a terminal, and then press Ctrl+t or use the mouse to go to the menu bar. Jan 22, 2016 at 22:48
  • Is there any way of doing it with a simple apt-get, though? Jan 22, 2016 at 22:51
  • 1
    you could run apt-get remove <package> then apt-get install <package> Jan 22, 2016 at 22:57
  • I'm using only aptitude, so I don't know how to do this with apt-get. If you there were only few packages you installed with this option, and if you know which ones, you could maybe just reinstall them. But that's just an idea... Jan 22, 2016 at 23:00

3 Answers 3

11

You can run apt-cache show package_you_care_about | grep Recommends.

This will show you all the recommended packages for that particular package. You can then install all the packages there.

For example, with gedit:

apt-cache show gedit | grep Recommends
output: Recommends: gir1.2-gtksource-3.0, zenity, yelp
sudo apt-get install gir1.2-gtksource-3.0 zenity yelp
1
  • Thanks! That's what I was looking for. Answered + upvote. Jan 22, 2016 at 23:10
5

To find all packages with missing recommended packages:

aptitude search '~RBrecommends:~i'
1

Get a list of installed packages with missing recommended package:

aptitude search '?installed?broken-recommends'

Get a list of not installed, missing packages that are recommended by installed packages - "missing recommends":

aptitude search '?broken-reverse-recommends(?installed)'

Get which package is recommending a specific "missing recommend":

aptitude search '?installed?broken-recommends(MISSING_PKG_NAME)'

One liner: For all "missing recommends", get by which packages are recommended:

for p in $(aptitude search -F%p '?broken-reverse-recommends(?installed)'); do echo $p; aptitude search "?installed?broken-recommends($p)"; done

You can find "missing recommends" in Synaptic package manager. (As I see, Synaptic shows also the missing Suggested packages.)

You can install all "missing recommends" with one command but I do not recommend it! First, review the list of packages before install. (For example, fresh install of debian buster shows missing "default-mta", which is a virtual package.)

apt install $(aptitude search -F%p '?broken-reverse-recommends(?installed)')

(This is summary from few similar questions. Hope it will help someone else.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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