Re: Automatic installation of packages
Hi Steven:
On Wed, 19 Jul 2006, Steven Hill wrote:
I have been reading the literature on debian packages, and I am trying
to figure out how to tell the package installer to automatically use
"apt-get install" to satisfy a dependency at installation time - is
there any way to do that? As far as I can see, the only effect of the
"Depends" section in the control file is to cause the installer to check
to see if the dependency is satisfied, and if not, abort the
installation and tell the user of the unsatisfied dependency.
Am I missing something obvious? It seems that this should be possible...
Perhaps I am misunderstanding the quesiton, but if you invoke apt-get to
install a particular package "foo" (and this goes for aptitude or synaptic
as well) which depends on package "bar", you will be asked whether you
want to install all of the dependent packages. See, for example, the
following:
hydride# apt-get install foo
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
bar
Suggested packages:
blah
Recommended packages:
blither
The following NEW packages will be installed:
foo bar
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 4039kB of archives.
After unpacking 12.1MB of additional disk space will be used.
Do you want to continue [Y/n]?
If you say "n" then it will abort, but if you say "y" then all the
dependencies will be installed.
If, however, you have downloaded the "foo" package and you try to install
it using dpkg, then you will have the abort as follows
hydride# dpkg -i foo_2.14.5-1_i386.deb
Selecting previously deselected package foo.
(Reading database ... 146690 files and directories currently installed.)
Unpacking foo (from foo_2.14.5-1_i386.deb) ...
dpkg: dependency problems prevent configuration of foo:
gdm depends on bar (>= 1.0.7); however:
Package bar is not installed.
dpkg: error processing bar (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
bar
The reason is that dpkg is basically a tool to install the pacakge while
apt is more of a package manager which checks dependencies, downloads the
required packages and then invokes dpkg to do the actual install of _all_
the downloaded packages at once. If dpkg is called with both foo and bar
to be instsalled, it will do it with no complaint. The answer is to use
apt-get or one of the other package managers (aptitude or synaptic) or
just use dselect which will also take care of things.
Hope this is the question you were asking.
Carlo
--
Carlo U. Segre -- Professor of Physics
Associate Dean for Special Projects, Graduate College
Illinois Institute of Technology
Voice: 312.567.3498 Fax: 312.567.3494
Carlo.Segre@iit.edu http://www.iit.edu/~segre
Reply to: