How can I check dependency list for a deb package


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

# dpkg -I package.deb | python -c "import sys, re; t=re.split(r'\n(?= ?[\w]+:)|:',; print '\n'.join([i.strip() for i in {key.strip(): value.strip() for key, value in zip(t[::2], t[1::2])}['Depends'].split(',')])" #

Expanded for humans:

dpkg -I package.deb | python -c " import sys, re; # Split keys and values into pairs (zipped together later) t=re.split( r'\n(?= ?[\w]+:)|:', ); # Newline separate each dependency print '\n'.join([ # Trim each dependency value i.strip() for i in { # Build assoc array from package metadata key.strip(): value.strip() for key, value in zip(t[::2], t[1::2]) }['Depends'].split(',') ])...
0 0

When you use apt to install a package, internally it uses dpkg. When you install a package using apt, it first creates a list of all the dependencies and downloads it from the repository.

Once the download is finished it calls dpkg to install all those files, satisfying all the dependencies.

So if you have a .deb file:

You can install it using sudo dpkg -i /path/to/deb/file followed by sudo apt-get install -f.

You can install it using sudo apt install ./name.deb (or /path/to/package/name.deb).
With old apt-get versions you must first move your deb file to /var/cache/apt/archives/ directory. For both, after executing this command, it will automatically download its dependencies.

Install gdebi and open your .deb file using it (Right-click -> Open with). It will install your .deb package with all its dependencies.

(Note: APT maintains the package index which is a database of available packages available in repo defined in...

0 0

Before installing a Debian package, I want to check if the current system has all the depending packages installed. Below is what I am currently doing (using bsdgames as an example). Note, I do not want to automatically install dependencies. I just want to know if the current system satisfies the dependency or not. Before you try to answer my question, or mark it as duplicate, please at least read it carefully. Thanks.

$ dpkg -I bsdgames_2.17-21_amd64.deb | grep Depends Depends: libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libncurses5 (>= 5.5-5~), libstdc++6 (>= 4.1.1), libtinfo5, wamerican | wordlist $ apt-cache policy libc6 | grep Installed Installed: 2.15-0ubuntu10.5 $ apt-cache policy libgcc1 | grep Installed Installed: 1:4.6.3-1ubuntu5 ... $ apt-cache policy wamerican | grep Installed $ apt-cache policy wordlist | grep Installed

Then I know two dependencies are missing and the package cannot be installed.

But I have to do this procedure manually, is there any automatic...

0 0

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.

In addition to the dpkg method, you can check the dependencies of packages in the repository:

apt-cache depends package-name

EDIT Updated with @Tino's recommendation. @Tigran's comment no longer applies.

This will show you all the information about the package:

dpkg -I package.deb

apt-cache depends [Package-Name] will work as well. Although if you source the .deb package from outside your sources list, things like apt-cache showpkg [Package-Name] && apt-cache depends [Package-Name] might show outdated info or might not sync with the actual installed package hence dpkg -I [Package-Name] would work best in that case.

Here is some sloppy, and probably not very encompassing...

0 0

Sirex has it more or less correct, but his answer isn't clear. I just solved this, so here's what I did:

sudo dpkg -i /path/to/filename.deb

If this fails with a message about the package depending on something that isn't installed, you can probably fix it if you run

sudo apt-get -f install

This will install the dependencies (assuming they're available in the repos your system knows about) AND the package you were originally requesting to install ('f' is the 'fix' option and 'y' is the 'assume yes to prompts' or 'don't ask me if it's ok, just install it already' option -- very useful for scripted silent installs). On the system I was on, there was no need to run dpkg again (Ubuntu lucid 10.04).

I found it interesting that if you leave off the -f when you run sudo apt-get install, it will list your package as not being configured due to an unresolved dependency as well as helpfully suggesting: Unmet dependencies. Try 'apt-get -f install' with no...

0 0
My question is about dependency checks for the DEB package.

Using a third-party install generation tool, I created a .DEB installation package for my application.

There are several dependencies that are required to be present on user’s Linux OS for my application to run properly. Specifically, “make”, and several “.so” libraries, like,, etc.

Not all of our Ubuntu users may have required dependencies installed prior to running my package installer.

This third-party installer tool that I used, generates DEB package, but does not include dependency checks.

As members of the Ubuntu community, could you please comment on how a custom .DEB package without dependency checks may be received by Linux-Ubuntu users?

Is it acceptable enough to deliver .DEB for a custom application that does not check dependencies?

Or is it uncommon enough to ‘anger’ Linux...

0 0

I am trying to package a program (FCL) but it has a dependency - libccd - which I had to package myself. So now I have created a libccd_2.0-1.deb file using check-install and I would like it to be installed as FCL dependency. So I added libccd (>= 1.0) in the control file of FCL Debian package. But the FCL package is complaining that it can't find the dependency libccd.

How can I make FCL package install the libccd_2.0-1.deb when it sees the dependency libccd? Also, where should I add the .deb file in the FCL Debian package?

No you can't. dpkg (which is used for installing individual .deb files) cannot fullfil dependencies.

Dependencies can be resolved only by apt-get / aptitude, but they cannot install .deb files directly, they can install packages only from repositories. Each repository has a metadata file and apt build its knowledge database, so when dependency says package libccd is needed, it will know that is available from repository XY.

But dpkg...

0 0
0 0

am a new Ubuntu Linux user. I need to install a package called package.deb. I know I can use Synaptic front-end package management tool to install packages from the CD or Internet. But, I would like to install a special .deb file. How can I install .deb package from the terminal using command line option in Ubuntu Linux or Debian Linux?

You need

to use the dpkg command

, which is a package manager from shell/command prompt for Debian and Ubuntu Linux. You can use this tool to install, build, remove and manage packages. dpkg itself is controlled entirely via command line parameters.


The syntax is as follows:

dpkg -i package-name-here.deb dpkg --install package-name-here.deb dpkg -i -R /path/to/dir/name/with/lots/of/dot-deb-files/ dpkg -i --recursive /path/to/dir/name/with/lots/of/dot-deb-files/


-i or --install : Install the package.-R or --recursive : Recursively installed all *.deb files found at specified...
0 0

No you can't. dpkg (which is used for installing individual .deb files) cannot fullfil dependencies.

Dependencies can be resolved only by apt-get / aptitude, but they cannot install .deb files directly, they can install packages only from repositories. Each repository has a metadata file and apt build its knowledge database, so when dependency says package libccd is needed, it will know that is available from repository XY.

But dpkg doesn't know where to search for needed packages. You can install your packages either by installing the libccd*.deb first, then by installing the fcl*.deb itself. Or preferably you can put them both as parameters of one dpkg call like this: dpkg -i fcl*.deb libccd*.deb and dpkg will figure itself which of those 2 to install first. (Or you can create your own repository where you will have both packages with related...

0 0

A typical .deb package relies on other packages to install and operate properly. With package managers such as apt-get and aptitude, you can resolve package dependencies, and have all prerequisites installed automatically.

Suppose for whatever reason, you want to manually resolve package dependencies of a particular package, in which case you need to identify all its dependent packages first.

In the following, I will explain how to check package dependencies on Ubuntu or Debian.

A command-line tool called apt-rdepends can help you in this case. This tool can recursively check dependencies of .deb package, and list all found package dependencies.

To install apt-rdepends on Ubuntu or Debian:

$ sudo apt-get install apt-rdepends

To show package dependency information of a particular package (e.g., tcpdump), run the command with package name:

$ apt-rdepends tcpdump

Reading package lists... Done Building dependency tree Reading...
0 0

A typical RPM package on Red Hat-based systems requires all its dependent packages be installed to function properly. For end users, the complexity of such RPM dependency is hidden by package managers (e.g., yum or DNF) during package install/upgrade/removal process. However, if you are a sysadmin or a RPM maintainer, you need to be well-versed in RPM dependencies to maintain run-time environment for the system or roll out up-to-date RPM specs.

In this tutorial, I am going to show how to check RPM package dependencies. Depending on whether a package is installed or not, there are several ways to identify its RPM dependencies.

Method One

One way to find out RPM dependencies for a particular package is to use rpm command. The following command lists all dependent packages for a target package.

$ rpm -qR

Note that this command will work only if the target package is already installed. If you want to check package dependencies for any...

0 0