How can I check dependency list for a deb package. I am running Ubuntu 11.10 and I have backed up all deb packages from var/cache/apt/archives
. I want to format my pc and re-install selected applications only. Also how can I get the list of installed packages and dependencies.
This will show you all the information about the package:
In addition to the
dpkg
method, you can check the dependencies of packages in the repository:EDIT Updated with @Tino's recommendation. @Tigran's comment no longer applies.
depends VS rdepends
apt-cache
depends
package-name//show package-name depends on who
apt-cache
rdepends
package-name//show who depends on package-name
depends
rdepends
For 14.04 and later:
dpkg
doesn't have the-I
any more and you have to usedpkg-deb
to show package information including dependencies:apt-cache depends [Package-Name]
will work as well. Although if you source the.deb
package from outside your sources list, things likeapt-cache showpkg [Package-Name] && apt-cache depends [Package-Name]
might show outdated info or might not sync with the actual installed package hencedpkg -I [Package-Name]
would work best in that case.I know this question is very old, but it is possible. I also had to dig through StackOverflow/AskUbuntu for ALL of this.
This ONLY SHOWS what depends are in the first package. Not all.
There might be some duplicates in the script methods but you can probably filter them out by doing this:
Here are the methods:
In a script
In a script, but not downloaded (remote)
Human readable
Human readable (remote)
Get amount of dependencies
Get amount of dependencies (remote)
In case you have the uninstalled package (usually downloaded manually from outside a repository), you need to use dpkg. The following command will show a summary of the package informations, including it's dependencies:
In case the package is already installed on your machine (originated from the repository or from a manual download), or is not installed but is available in the repository, you can use apt. The following command will show only the list of it's dependencies.
Here is some sloppy, and probably not very encompassing post-processing you can do to
dpkg -I
output to get dependency items as a list:Condensed for computers
Expanded for humans:
For a specific package version:
To find available versions: How can I check the available version of a package in the repositories?