Cloud
Cloud

Reputation: 19333

DPKG/APT-GET simulated install while "hiding" dependencies

I have some .deb files which I am currently modifying to have varying dependencies in the control file within the archive. I would like to be able to do simulated installations via:

sudo dpkg --install --simulate ./myFile.deb

The install script is meant to exercise some varying logging capabilities depending on certain combinations of dependency mismatches, etc. For example, one of my packages depends on the presence of libusb-1.0-0 > 1.0.0.16, and I already have the latest available version installed on my test system. Is it possible to pass a flag to dpkg so that it either:

  1. Thinks that libusb is either a different version than that which is currently installed.
  2. Thinks that libusb, or any other arbitrary library/package is not already installed.

Thank you.

Upvotes: 1

Views: 453

Answers (1)

Phil Miller
Phil Miller

Reputation: 38138

You could take snapshots of /var/lib/dpkg/ in the various states you wish to test, and then pass the path of those snapshots to dpkg with the --admindir=... flag.

Upvotes: 1

Related Questions