Disclaimer: I would say that the way distributions encourage users to install software is apt
these days, which is a package manager that checks if the dependencies between packages are intact, you can issue an update to all your software that can be fetched from the source repositories list.
While it can be that installing a program with the .deb package doesn't add the repository to apt for automatic updates, some .deb installations do just that: they add repositories to apt for further updates or make it possible for you to add them manually and then install the software. Example: 'Visual Studio Code'.
https://code.visualstudio.com/docs/setup/linux
I cite from their website:
Debian and Ubuntu based distributions
The easiest way to install Visual Studio Code for Debian/Ubuntu based
distributions is to download and install the .deb package (64-bit),
either through the graphical software center if it's available, or
through the command line with:
sudo apt install ./<file>.deb
Installing the .deb package will automatically install the apt
repository and signing key to enable auto-updating using the system's
package manager. Note that 32-bit and .tar.gz binaries are also
available on the VS Code download page.
The repository and key can also be installed manually with the
following script:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Then update the package cache and install the package using:
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code # or code-insiders
EDIT:
A discussion in the comments to this post started with some people being confused about calling apt with a path to the file being installed. While apt's great functionality is managing the software packages and updating them from the list of repositories apt gets, it can also be used to install a downloaded package, like in the case above. Perhaps it could also be installed with the dpkg -i
with the same effect - I do not know that. What I can say is that the downloaded package from the example above gets the signature, updates the apt list of repositories with the signed source repo. And that the software the Visual Studio recommends for installing it is apt.
More generally apt, apt-get and apt-cache is a software included in APT, and they are package managers. apt
has a set of commands in common with apt-get
and apt-cache
, and those are widely used package management commands that are scattered across both of them. So apt is a set of few universal every-day use commands and is supposed to be more user-friendly that way. For more comparison see this easy-read article: https://itsfoss.com/apt-vs-apt-get-difference/.
IN CONTRAST dpkg is another software that APT package manager calls to say which packages and of which versions to install so that the packages on the system interact with each other nicely and don't cause some conflicts.
"While dpkg performs actions on individual packages, APT manages relations (especially dependencies) between them, as well as sourcing and management of higher-level versioning decisions (release tracking and version pinning). A major feature of APT is the way it calls dpkg — it does topological sorting of the list of packages to be installed or removed and calls dpkg in the best possible sequence. In some cases, it utilizes the --force options of dpkg. However, it only does this when it is unable to calculate how to avoid the reason dpkg requires the action to be forced. " -source: https://en.wikipedia.org/wiki/APT_(software)#Front-ends