Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 this be clear: it says the packages are installed, but they 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.

Now, how would this be useful? I would like to be able to test the installation of packages on a bare Debian or Ubuntu system. I want to know if a package is installable given a certain scenario. To do this with actual installation would take a lot of disk space and time.

APT has a "simulate" option, but it does not mark packages as installed.

share|improve this question

migrated from stackoverflow.com Oct 28 '11 at 11:07

This question came from our site for professional and enthusiast programmers.

up vote 9 down vote accepted

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 and dpkg-python anymore. dpkg-awk and dpkg-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 and apt-get both have options to run with different administration and root directories. The dpkg man page has them, but the apt-get one is buried in apt.conf.


The configuration item RootDir has a special meaning. ...

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.

share|improve this answer
Can you point me to one of these scripting interfaces you mention? – Nicolas Marchildon Sep 29 '08 at 18:12

This will just give you a severely broken system. Why do you want to do something this bizarre in the first place?

I suspect this is a XY problem: You need X, figure out a way to do it is through Y, and ask about Y. Without knowing what X is, there is no way we could give reasonable solutions for it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.