Unix & Linux: How to install a deb file, by dpkg -i or by apt? (7 Solutions!!)

preview_player
Показать описание
Unix & Linux: How to install a deb file, by dpkg -i or by apt?

The Question: I have a deb package for installation.
Will both handle the software dependency problem well?
If by apt, how can I install from the deb by apt?

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 15 people ==
directly with apt-get but I never tried. Doesn't work, apt-get and dpkg are
looking for packages listed in archives.

== This solution helped 97 people ==
unresolved dependencies, run apt-get install -f afterwards.

== This solution helped 989 people ==
DebianPackageManagement it uses dpkg. When you install a package using apt, it
first creates a list of all the dependencies and downloads it from the
repository.
Once the download is finished it calls dpkg to install all those files,
satisfying all the dependencies.
**** So if you have a .deb file, you can install it by: ****
1. Using:
sudo dpkg -i /path/to/deb/file
sudo apt-get install -f
2. Using:
Or
With old apt-get versions you must first move your deb file to /var/
cache/apt/archives/ directory. For both, after executing this command, it
will automatically download its dependencies.
3. First installing gdebi and then opening your .deb file using it (Right-
click -> Open with). It will install your .deb package with all its
dependencies.
Note: APT maintains the package index which is a database of available
satisfy the software dependency if the dependencies required by the deb
is not present in the package index.
----
**** Why use sudo apt-get install -f after sudo dpkg -i /path/to/deb/file (as
mentioned in method 1)? ****
From man apt-get:
-f, --fix-broken
Fix; attempt to correct a system with broken dependencies in place.
When dpkg installs a package and a package dependency is not satisfied, it
leaves the package in an "unconfigured" state and that package is considered
broken.
The sudo apt-get install -f command tries to fix this broken package by
installing the missing dependency.

== This solution helped 6 people ==
apt-get is a higher level installer based off of dpkg, and as such you could
It would be beneficial for add it to your apt-get archives directory (/var/
cache/apt/archives) so you could reference it as a package with dependencies
and not a standalone .deb archive.
Also, by adding it to your apt-get archives directory, you have the opportunity
to use dependencies with apt-get install packagename. This would let you
install it with any manually added dependencies instead of dpkg's standalone
archive-based system.

Рекомендации по теме