0

Aptitude version 0.8.7

Debian 9 (Stretch)

During a recent package upgrade, the Aptitude GUI displayed the following warning, boxed and in bright red:

W: APT had planned for dpkg to do more than it reported back...

Said displayed warning also contained information concerning the number of planned actions vs. the number of executed actions, as well as information concerning which particular package was the one that was affected, but I stupidly acknowledged the squawk before recording this additional information (thinking I could reference a log somewhere).

Well, I can't find the proper log file. FYI, /var/log/aptitude shows the recent activity, but the subject warning message is absent...

The following three links may provide some insight, but I still can't find the desired log:

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1647638

https://askubuntu.com/questions/1378118/apt-had-planned-for-dpkg-to-do-more-than-it-reported-back

https://groups.google.com/g/linux.debian.bugs.dist/c/n74RYhzpzNM

Where can I find the desired log file?

2 Answers 2

2

There aren't any - aptitude doesn't write errors or warnings to disk by default. All that goes in /var/log/aptitude are installations.

If you want extra logging you need to tell aptitude that.

From man aptitude:

   --log-file=<file>
       If <file> is a nonempty string, log messages will be written to it, except that if
       <file> is “-”, the messages will be written to standard output instead. If this option
       appears multiple times, the last occurrence is the one that will take effect.

       This does not affect the log of installations that aptitude has performed
       (/var/log/aptitude); the log messages written using this configuration include
       internal program events, errors, and debugging messages. See the command-line option
       --log-level to get more control over what gets logged.

       This corresponds to the configuration option Aptitude::Logging::File.

   --log-level=<level>, --log-level=<category>:<level>
       --log-level=<level> causes aptitude to only log messages whose level is <level> or
       higher. For instance, setting the log level to error will cause only messages at the
       log levels error and fatal to be displayed; all others will be hidden. Valid log
       levels (in descending order) are off, fatal, error, warn, info, debug, and trace. The
       default log level is warn.

       --log-level=<category>:<level> causes messages in <category> to only be logged if
       their level is <level> or higher.

       --log-level may appear multiple times on the command line; the most specific setting
       is the one that takes effect, so if you pass --log-level=aptitude.resolver:fatal and
       --log-level=aptitude.resolver.hints.match:trace, then messages in
       aptitude.resolver.hints.parse will only be printed if their level is fatal, but all
       messages in aptitude.resolver.hints.match will be printed. If you set the level of the
       same category two or more times, the last setting is the one that will take effect.

       This does not affect the log of installations that aptitude has performed
       (/var/log/aptitude); the log messages written using this configuration include
       internal program events, errors, and debugging messages. See the command-line option
       --log-file to change where log messages go.

       This corresponds to the configuration group Aptitude::Logging::Levels.

[edit] OK ... trying to lead you to water and making you drink is taking too long:

Just create the file /etc/apt/apt.conf.d/50aptitude with the following content - which will also save you having to use command-line switches:

Aptitude::Logging::File "/var/log/aptitude.out";
Aptitude::Logging::Levels "*:info";
9
  • Can't get this to work. I've added a spurious line to the etc/apt/sources.list file, which induces several "error" messages when I input (as root) aptitude --log-level=info However, none of said error messages show up in /var/log/aptitude
    – Digger
    Sep 30, 2023 at 3:37
  • Wrong file. Scroll to the bottom of the man-page, check the FILES section. What made you think that sources.list was the right place for that, @Digger ?
    – tink
    Sep 30, 2023 at 5:04
  • Thanks for your attention to this matter! I modified said sources.list file merely to corrupt same so that some errors would be generated when I called up Aptitude (this, hopefully, being an easy way to "force" Aptitude to generate error messages). I then expected, as a result of my test, to find said error messages logged in /var/log/aptitude, but could find nothing...
    – Digger
    Sep 30, 2023 at 14:41
  • @Digger If you expected to find warnings in /var/log/aptitude you clearly haven't read all of the above .. upping the log-level will make output on stderr more garrulous, but never log to that file. Out of curiosity: which problem are you trying to solve by writing these to a log file?
    – tink
    Sep 30, 2023 at 18:21
  • Thank you. I'm trying to avoid a repeat of the incident I documented in the OP - that is, losing information concerning a package that may not have been updated properly...
    – Digger
    Sep 30, 2023 at 19:37
1

Here's what worked for me:

Whenever I call up Aptitude, I use

aptitude --log-file=/tmp/AptitudeLog.log --log-level=info

Then, because I'll never remember where to look if I need any associated log info, I've left links to the above temporary log file in /var/log and /var/log/apt

End of problem!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .