I would like to be able to view the scripts/triggers associated with a package due for upgrade so that I can tell, for example, whether it will result in the web server being restarted. I can't find an aptitude option to show me that (or apt/dpkg); the best I can get is the contents (files). Is there some combination of simulate/verbose/contents switches that I have missed that will show this?
Additionally, if a package results in something happening - like a service restart - that I don't want to happen right now, is there a way to install the package without running some or all of the scripts?
You can print the control file and some other information with
dpkg -I package.deb
, or usedpkg -e package.deb
to extract only the control information files.Also, you can do a dry run to see what dpkg would do with
--dry-run
:No, I don't know of any way to do this using aptitude.
You can look at the scripts directly; the scripts that run during upgrade are contained in the package. Unpack the deb using ar:
Then look into
control.tar.gz
, it contains the scripts.There is also the
--debug
option fordpkg
, as insudo dpkg --debug=72200 -i package.deb
There are several available options for verbose output and they can be combined.
You can see all available options by running:
dpkg --debug=help
.No, you can't run part of a maintainer script, there's no hooks to make that happen.
You can only view what the script would do by examining it by hand -- again, no "dry run" can tell you exactly what it will and won't do, only "I will run the postinst with these args".
These are the reasons we have staging and test environments.