From all the other Q&A (like: What is the difference between dpkg and aptitude/apt-get?) I understand that apt-get is a wrapper over dpkg and provides dependency management.

Assuming I'm installing something that doesn't have any dependencies (or they're also installed at the same time) would there be any difference between installing it using apt-get vs dpkg

E.g. (kinda concrete differences I'm looking for)

  • say dpkg can not download the pkg from somewhere, I must download before starting installation, whereas apt-get will do this on my behalf.
  • dpkg won't configure pkg, it'll only copy files. apt-get will configure too.

...

up vote 16 down vote accepted

dpkg -i installs *.deb packages, which is to say packages you have already downloaded from somewhere. It also configures them, but does not download/install dependencies. You need to have downloaded the binary package file(s) manually from somewhere. There also may be hazards in downloading packages from locations that are not the repositories which your distro had included/enabled by default, since third-party packages can be malicious in nature.


apt-get/aptitude install automatically accesses the repositories and PPAs indexes you enabled, searches for the best candidate, downloads it and all its dependencies and installs and configures them automatically.

Using apt-get install -f, you can automatically install missing dependencies of packages e.g. installed through dpkg -i.

  • 5
    A quick note here, apt-get can install dependencies from packages installed with dpkg -i. Run apt-get install -f to accomplish that. – Ev1l0rd Dec 4 '15 at 14:44
  • 1
    @Ev1l0rd Correct, I added that to my answer. – Byte Commander Dec 4 '15 at 15:09
  • 2
    Another important difference, and a case for using apt-get or aptitude, is that they remember whether a package was installed manually (specifically requested), or whether it was installed to fulfill a dependency. That way, when you later remove a package, they are able to automatically remove (or at least tell you about) packages that were "automatically installed and are no longer required". If you installed each package with dpkg then you'd have to remember and manually remove not only your package but all of its dependencies (assuming nothing else depends on them). – Benjamin Staton Dec 4 '15 at 17:43
  • 1
    @BenjaminStaton Well, as dpkg -i does not care about dependencies, everything installed with it is of course installed "manually". – Byte Commander Dec 4 '15 at 17:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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