Q:

Building a .deb file, install dependencies too

I am part of a small team that develop an intranet web app. We want to a method of easy installation, so we were thinking about how apt-get works, especially with installing dependencies.
Our app has many dependencies (PHP5, PostgreSQL, FOP etc) but we need control over who has access to the installation.  With this in mind we started looking at building our own .deb file. It looks like I can define the dependencies in my control file but when we try to install the .deb file using dpkg, the dependencies are checked, fail and the installation stops.
What I did then was to run a apt-get -f install command to run the installation again with dependencies, but I don't want to do this.
So here's the question, is there a way that a .deb file can install the dependencies automatically, just like and apt-get install abc would?
Basically we want to make the installation as simple as possible, therefore we don't want the end user to be running any command that isn't absolutely necessary.

A:

Gdebi
gdebi installs a deb package and its dependencies. To use it run:
sudo gdebi package.deb

In newer versions of Ubuntu, this is not installed by default, so you will need to install it from the repositories.
See man gdebi for a full list of options.
gdebi is the command line equivalent to the graphical tool of the same name that used to be included by default in Ubuntu. The command for the graphical tool is gdebi-gtk and has similar functionality:

