How do I show the actions that installing a .deb package will take?

Solution 1:

You can print the control file and some other information with dpkg -I package.deb, or use dpkg -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:

dpkg --dry-run -i package.deb

Solution 2:

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:

ar -x package.deb

Then look into control.tar.gz, it contains the scripts.


Solution 3:

There is also the --debug option for dpkg, as in sudo 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.

pi@kaldi:~ $ dpkg --debug=help
dpkg debugging option, --debug=<octal> or -D<octal>:

 Number  Ref. in source   Description
      1  general          Generally helpful progress information
      2  scripts          Invocation and status of maintainer scripts
     10  eachfile         Output for each file processed
    100  eachfiledetail   Lots of output for each file processed
     20  conff            Output for each configuration file
    200  conffdetail      Lots of output for each configuration file
     40  depcon           Dependencies and conflicts
    400  depcondetail     Lots of dependencies/conflicts output
  10000  triggers         Trigger activation and processing
  20000  triggersdetail   Lots of output regarding triggers
  40000  triggersstupid   Silly amounts of output regarding triggers
   1000  veryverbose      Lots of drivel about eg the dpkg/info directory
   2000  stupidlyverbose  Insane amounts of drivel

Debugging options can be mixed using bitwise-or.
Note that the meanings and values are subject to change.

Tags:

Dpkg

Apt

Aptitude