19

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.

...

1 Answer 1

20

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.

4
  • 6
    A quick note here, apt-get can install dependencies from packages installed with dpkg -i. Run apt-get install -f to accomplish that.
    – Durandal
    Dec 4, 2015 at 14:44
  • 1
    @Ev1l0rd Correct, I added that to my answer.
    – Byte Commander
    Dec 4, 2015 at 15:09
  • 3
    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). Dec 4, 2015 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, 2015 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .