How to install recommend packages from a file (package.deb)?

Solution 1:

One solution would be to set up your personal APT repository and install the package with APT from there.

Another possibility is to extract the dependencies from the package description. This script pulls the Recommends: line from the description in the .deb file and removes versions and keeps only the first alternative when there are several.

apt-get install $(dpkg-deb -I foo.deb |
                  sed -n 's/^ *\(Depends\|Recommends\)://p' |
                  tr , $'\n' |
                  sed 's/[|(].*//')

With aptitude, you can install the set of packages matched by a pattern. If there are alternatives, install the one you want first.

aptitude install '?reverse-recommends(foo)'

From the aptitude full-screen interface, highlight the package, press Enter, navigate to “Recommends” and press + then g.