diff -udr Fink.orig/Engine.pm Fink/Engine.pm
--- Fink.orig/Engine.pm	2004-09-25 18:31:20.000000000 +0200
+++ Fink/Engine.pm	2004-09-25 16:53:57.000000000 +0200
@@ -1382,6 +1382,20 @@
 	foreach $pkgname (sort keys %deps) {
 		$item = $deps{$pkgname};
 		next if $item->[OP] == $OP_INSTALL and $item->[PKGVER]->is_installed();
+		if (!$item->[PKGVER]->is_present() && $item->[OP] != $OP_REBUILD) {
+			my ($aptcmd, $pkgg, $package);
+			$package = $item->[PKGVER];
+			if (exists $package->{_relatives}) {
+				foreach $pkgg (@{$package->{_relatives}}){
+					if (!$pkgg->is_present() && $pkgg->is_aptgetable()) {
+						$pkgg->apt_fetch();
+						&real_install($OP_INSTALL, 0, 1, $pkgg->get_name());
+					}
+				}
+			}
+			$item->[PKGVER]->apt_fetch();
+		}
+
 		if ($item->[OP] == $OP_REBUILD or not $item->[PKGVER]->is_present()) {
 			$item->[PKGVER]->phase_fetch(1, 0);
 		}
diff -udr Fink.orig/Package.pm Fink/Package.pm
--- Fink.orig/Package.pm	2004-09-25 18:31:20.000000000 +0200
+++ Fink/Package.pm	2004-09-25 16:53:57.000000000 +0200
@@ -44,6 +44,7 @@
 our $essential_valid = 0;
 our $db_outdated = 1;
 our $db_mtime = 0;
+our $aptdb = {};
 
 END { }				# module clean-up code here (global destructor)
 
@@ -221,6 +222,19 @@
 	return 0;
 }
 
+### Find a specific package name/version in aptdb
+
+sub is_in_apt{
+	my $self = shift;
+	my $name = shift;
+	my $version = shift;
+
+	if (defined $aptdb->{$name}{$version}) {
+		return 1;
+	}
+	return 0;
+}
+
 ### get version object by exact name
 
 sub get_version {
@@ -340,6 +354,7 @@
 			 if (not $db_outdated) {
 				$packages = Storable::retrieve("$basepath/var/db/fink.db");
 			 }
+			$aptdb = Storable::retrieve("$basepath/var/db/finkapt.db");
 		}
 	}
 	
@@ -407,6 +422,33 @@
 		 ? 1 : 0;
 }
 
+### update the apt-get db file
+
+sub update_aptdb {
+	shift;
+
+	my ($pkg, $ver);
+	open(APTDUMP, "apt-cache dump |") || die "Can't run apt-cache dump: $!\n";
+	$aptdb = {};
+	while(<APTDUMP>) {
+		if (grep(/Package:/,$_)) {
+			chomp;
+			$pkg = $_;
+			$pkg =~ s/.*Package:[\ ]*//; 
+		}
+		if (grep(/Version:/,$_)) {
+			my $count;
+			chomp;
+			$ver = $_;
+			$ver =~ s/.*Version:[\ ]*//;
+			$aptdb->{$pkg}{$ver}++;
+		}
+	}
+	close APTDUMP;
+
+	Storable::lock_store($aptdb, "$basepath/var/db/finkapt.db");
+}
+
 ### read the packages and update the database, if needed and we are root
 
 sub update_db {
@@ -440,6 +482,7 @@
 		}
 	};
 	$db_outdated = 0;
+	Fink::Package->update_aptdb();
 }
 
 ### scan one tree for package desccriptions
diff -udr Fink.orig/PkgVersion.pm Fink/PkgVersion.pm
--- Fink.orig/PkgVersion.pm	2004-09-25 18:31:21.000000000 +0200
+++ Fink/PkgVersion.pm	2004-09-25 18:30:08.000000000 +0200
@@ -31,7 +31,7 @@
 					  &get_path &eval_conditional);
 use Fink::CLI qw(&print_breaking &prompt_boolean &prompt_selection_new);
 use Fink::Config qw($config $basepath $libpath $debarch $buildpath);
-use Fink::NetAccess qw(&fetch_url_to_file);
+use Fink::NetAccess qw(&fetch_url_to_file &fetch_url);
 use Fink::Mirror;
 use Fink::Package;
 use Fink::Status;
@@ -1064,6 +1064,53 @@
 	return 1;
 }
 
+sub is_aptgetable {
+	my $self = shift;
+	if (defined Fink::Package->is_in_apt($self->get_name(), $self->get_fullversion())) {
+		return 1;
+	}
+	return 0;
+}
+
+sub apt_fetch {
+	my $self = shift;
+	my $aptcmd = "apt-get -qq --print-uris install " . $self->get_name() . "=" .$self->get_fullversion();
+	print STDERR "Retrieving uri for " . $self->get_debname() . " via apt-get\n";
+	my $aptcmd_res = `$aptcmd`;
+	my @aptcmd_res_lines = split(/\n/, $aptcmd_res);
+	
+	# 'apt-get --print-uris' give back a line for each package that would be installed
+	# so we have to find the corresponding line for the package in question
+ my ($aptcmd_res_line, $deb_uri, $deb_name, $deb_size, $deb_md5);
+ my $deb_found = -1;
+ foreach $aptcmd_res_line (@aptcmd_res_lines) {
+  ($deb_uri, $deb_name, $deb_size, $deb_md5) = split(/ /, $aptcmd_res_line);
+  if ($deb_name eq $self->get_debname()) {
+   # that's the line we want
+   $deb_found = 1;
+   # remove the quotes around the uri
+   $deb_uri =~ s/'(.*)'/$1/;
+   last;
+  }
+	}
+	if ($deb_found != 1) {
+	 print "Apt-get didn't find the uri for " . $self->get_debname() . "!\n";
+	 return 0;
+	}
+	
+ my $downloaddir = "$basepath/fink/debs/";
+	if (&fetch_url($deb_uri, $downloaddir)) {
+		print "Downloading the binary package '" . $self->get_debname() . "' from the URL '$deb_uri' failed.\n";
+	 return 0;
+	}
+	else {
+		my $tmpdeb = $downloaddir . $self->get_debname();
+		symlink "$basepath/var/cache/apt/archives/" . $self->get_debfile(), $tmpdeb;
+		return 1;
+	}
+	return 0;
+}
+
 sub is_present {
 	my $self = shift;
 
@@ -1125,6 +1172,11 @@
 			return $fn;
 		}
 	}
+	$fn = "$basepath/var/cache/apt/archives/$self->{_debname}";
+	if (-f $fn) {
+		return $fn;
+	}
+
 	return undef;
 }
