Here's what I would like:
Start with a virtual system, with no installed packages. Then I invoke a tool, similar to apt-get
to ask it to compute the dependencies and mark all the packages that would be installed as installed.
Let me be clear: It says the packages are installed, but there are no files actually installed.
Then, if I ask for more packages to be "installed", it may propose to add or remove other packages. It wouldn't actually remove packages, but obviously just mark them removed.
This would be useful because, I would be able to test the installation of packages on a bare Debian or Ubuntu system. It would, allow me to know if a package is installable given a certain scenario.
Doing this to an actual installation would take a lot of disk space and time.
apt
has a "simulate" option, but it does not mark packages as installed.
Best Answer
You're probably best off hooking into one of the scripting interfaces that Debian has for their various package tools and writing your own simulator.
(Edit: I can't find
dpkg-perl
anddpkg-python
anymore.dpkg-awk
anddpkg-ruby
exist, but they don't look like they'll do the job.)However: Debian has a tool "equivs" that lets you build "empty" packages that just satisfy dependencies, but install no files beyond the control files. http://packages.debian.org/search?keywords=equivs
dpkg
andapt-get
both have options to run with different administration and root directories. Thedpkg
man page has them, but theapt-get
one is buried inapt.conf
.aptitude lets you pick and choose what to install, and then "commits" it by running dpkg and/or apt with the right settings. Playing around with it might be sufficient for some of your needs, though you'll want to save the settings before hand, and restore afterword.