0

I've often been recommended to install the .deb files by CLI (i.e., by sudo dpkg -i filename) than by simply double clicking the .deb file. I dont see why is it recommended so. Also, I'm curious to know what is the difference between these two modes of installation.

  • The end result is the same. – ChanganAuto Aug 27 '21 at 08:47
  • No difference. Since you said you've "often been recommended", perhaps you should ask whoever recommended it to you instead? I guess some people like seeing what it's doing instead of a simple progress bar. – Ray Aug 27 '21 at 08:52
  • 1
    In this case, the software centre is like gdebi - it will install missing dependencies, which dpkg -i doesn't do. – muru Aug 27 '21 at 08:55
  • @muru I don't think Ubuntu Software (double click) will automatically install the dependencies to an offline .deb file like GDebi does. Whenever I tried to install an offline .deb file with double click, it failed. With GDebi, it succeeded. – raj Aug 27 '21 at 11:04
  • @raj which version of Ubuntu? It might depend on which Ubuntu Software you have. The snap-based one might not work, I'm not sure about that. – muru Aug 27 '21 at 12:13
  • @muru I'm indeed talking about the snap-based one, because that's the one in current versions. I have Ubuntu 20.04. – raj Aug 27 '21 at 13:02

1 Answers1

6

dpkg cannot automatically install the dependencies, whereas a GUI .deb installer (e.g. GDebi) installs all the required dependencies.

This is why, if you use dpkg without installing the dependencies first, you may end up with broken packages (which can be easily fixed in most cases with sudo apt install -f).

To automatically get all the dependencies with command line, use the following command,

sudo apt install ./path/to/package.deb

Practically, this has no difference from installing with GDebi.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212