Install dependencies for a dpkg package?

I have a dpkg file that i want to install.

But I get error messages that it is depending on other packages.

I used:

dpkg -i file.dpkg

Is there a way to install dependencies automatically without having to use apt-get/aptitude (the latest version of this dpkg wasnt available)


Solution 1:

If this is a one-off, copy-paste the package names from the dpkg error message to an aptitude install command line. Otherwise, set up an apt repository for your own package, it's not hard. Here are a few possible methods:

  • If this is for Ubuntu, you can create your own personal package archive. This will make your packages easily available to everyone, so this method is suitable for generally-useful packages but not for in-house stuff.

  • You can set up a local repository using reprepro. It takes a couple of minutes to set up, but after that adding new packages is trivial (reprepro includedeb mydistribution /path/to/my.deb).

  • Another way to set up a local repository is to use apt-ftparchive from the apt-utils package. This is less automated than reprepro.

  • If all you're doing is patching or recompiling existing packages, apt-build is also an option.

Solution 2:

You might break dependencies but here is a way to fool apt-get to install your own tar ball. http://www.debian.org/doc/manuals/apt-howto/ch-helpers.en.html#s-equivs