Automatically solve dependencies of deb packages while using dpkg -i [duplicate]

You can install a package and get dependencies from repositories with

sudo gdebi package.deb

If you already installed the package with missed dependencies, you can dowload and install dependencies automatically with

sudo apt-get -f install

Also available is a graphical version gdebi-gtk, linked to .deb nautilus right click action "Open With GDebi Package Installer".


From the 1.1 branch onwards, apt-get supports installing local packages along with dependencies in the way of:

sudo apt-get install ./your-package.deb

Note the ./ in front of package file name, which is mandatory otherwise the name will be used as package name, not a file name.


dpkg itself is not capable of managing repositories. A higher-level tool like apt-get is required to fetch anything from repositories. dkpg is only the core tool that installs/removes/configures packages, taking care of dependencies and other factors. apt-get and aptitude are tools that manage repositories, download data from them, and use dkpg to install/remove packages from them. This means that apt-get and aptitude can resolve dependencies and get required packages from repository, but dpkg cannot, because it knows nothing about repositories.


You can use apt-get -f install to install all the packages dpkg -i complains about (but looking at your question you probably knew that ;) ).

gdebi might be a better alternative.

Description: Simple tool to install deb files
gdebi lets you install local deb packages resolving and installing its 
dependencies. apt does the same, but only for remote (http, ftp) located 
packages. 

On a 3rd note... gdebi was replaced by the Ubuntu Software Center. If you install the .deb from within GDM (nautilus) USC will take over and try to install the deb. And that includes the dependencies. That is if you are not bound to command line ;)


That particular library(libctemplate0) I downloaded it from

http://packages.ubuntu.com/lucid/amd64/libctemplate0/download

The direct link http://ubuntu.wikimedia.org/ubuntu//pool/universe/c/ctemplate/libctemplate0_0.96-0ubuntu1_amd64.deb

The mySQL-workbench installation went smoothly after that.