Quick Summary
To install a manually downloaded .deb package and also automatically download and install the packages it depends on from your configured repositories:
- You can run
sudo apt-get -f install after installing your .deb with dpkg -i.
- Or use
gdebi to install a .deb package and automatically resolve its dependencies (apt-get will not do this, but gdebi and its graphical frontends will).
See below for details.
Why apt-get Won't Do This
apt-get checks your configured software sources (repositories) and automatically downloads and installs packages. Except in the case where a configured repository is inaccessible, this does not enable an apt-get install command to succeed that would not otherwise succeed. If the package isn't in one of your repositories, apt-get will not know to install it even if the .deb file happens to be in /var/cache/apt/archives.
Thus:
If you have a package already downloaded, and it is the same package apt-get would automatically download and install, then you can put it /var/cache/apt/archives and apt-get will not have to download it.
If you have a package already downloaded which is not the same package apt-get would automatically choose, but which is nonetheless available in a configured repository, then you can put it in /var/cache/apt/archives and force apt-get to attempt to install it instead of the package it prefers. For example:
sudo apt-get install abiword=3.0.1-1
Neither of those situations applies to your case. The specific package version is not provided by any of the configured repositories, because it is instead an alpha testing version from the upstream project's download page. Because you have no repository that provides that version of that package, you cannot install your manually downloaded .deb file with apt-get.
Way 1: Install with dpkg and Resolve Dependencies with apt-get
Fortunately, it doesn't look like you need to install this package with apt-get. It appears your actual goal is
- to install the manually downloaded .deb package, which isn't provided by your repos (which
dpkg can do, but apt-get cannot), and also
- to install any its dependencies that are provided by its repos (which
dpkg cannot do, but apt-get can).
You can do this in two separate steps:
Install the package with dpkg.
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
That created missing dependencies. apt-get can fix missing dependencies automatically.
sudo apt-get -f install
That should also automatically finish configuring the original package. (So you will not likely need to run sudo dpkg --configure -a yourself.)
Way 2: Use gdebi to Both Install and Resolve Dependencies
While apt-get won't attempt to automatically install an arbitrary .deb file and its dependencies, there is a tool made for this purpose: gdebi
. From man gdebi:
gdebi lets you install local deb packages resolving and installing its dependencies. apt does the same, but only for remote (http, ftp) located packages.
To use gdebi in a terminal, run gdebi package.deb as root, e.g.:
sudo gdebi wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
gdebi also has graphical frontends. You'll probably want to use gdebi-gtk, the GTK+ frontend:
gksudo gdebi-gtk wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
But if you're running Kubuntu (or otherwise using KDE) you might prefer gdebi-kde, the KDE frontend (provided by the gdebi-kde
package):
kdesudo gdebi-kde wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
The graphical frontends may also be called without arguments (e.g., gksudo gdebi-gtk), in which case you may click File > Open to browse for and select the .deb file from within the GUI.
