0

I faced a problem: dpkg says that preinst script fails with exit code 1 but I see no output. I looked into script itselt (dpkg -e) and found what's wrong. But if there were output of preinst script, the problem would be revealed clearly!

Maybe there is some param or --debug value for dpkg?

1 Answers1

1

Good way is check /var/log/dpkg.log when something already goes wrong.

Also:

man dpkg say:

-Doctal, --debug=octal Switch debugging on. octal is formed by bitwise-oring desired values together from the list below (note that these values may change in future releases). -Dh or --debug=help display these debugging values.

              Number   Description
                   1   Generally helpful progress information
                   2   Invocation and status of maintainer scripts
                  10   Output for each file processed
                 100   Lots of output for each file processed
                  20   Output for each configuration file
                 200   Lots of output for each configuration file
                  40   Dependencies and conflicts
                 400   Lots of dependencies/conflicts output
               10000   Trigger activation and processing
               20000   Lots of output regarding triggers
               40000   Silly amounts of output regarding triggers
                1000   Lots of drivel about e.g. the dpkg/info dir
                2000   Insane amounts of drivel
Ivan Gurzhiy
  • 306
  • 1
  • 1
  • What exact value of `--debug` corresponds to stdout/stderr of scripts? I'm not very familiar with `dpkg` terminology... – George Sovetov Oct 11 '18 at 12:55
  • @GeorgeSovetov It's turn more verbose output to the stdout and all steps clearly viewed. Also there is another "similar" question which helps with logging: https://unix.stackexchange.com/questions/192877/logging-apt-dpkg-activity-to-syslog – Ivan Gurzhiy Oct 11 '18 at 20:53