My system is Debian Wheezy. I have noticed that when I run apt-get, additionally to /var/log/apt/history.log another log file gets created /var/log/apt/term.log. It seems to me that term.log contains the output that was sent to the terminal.

What sense does it make to log this? Is there a way to disable it? I don't want to log useless information.


If you need to figure out what happened during the installation of a package, the information is there.

This file is unlikely to contain any information that would affect your privacy. Maybe some edge cases such as which mirror you downloaded a few files from, which could reveal your broad geographical location. But other system logs have far more detailed information, so this is irrelevant unless you've done a lot of scrubbing already (in which case, just include this file in your scrubbing).

The size of the file is insignificant by today's standards (and even by yesterday's).

The location of the file is determined by the APT settings Dir::Log (default: /var/log/apt) and Dir::Log::Terminal (default: term.log). If you set this option to an empty string in /etc/apt/apt.conf (Dir::Log::Terminal ""), the log file won't be created. But again, that's pointless.

| improve this answer | |
  • What do you mean by the size of the file is insignificant? I'm having disk space problems in my PC and this file is 5.9 Gb... – Juan Feb 9 '17 at 15:12
  • 1
    @Juan By default the file is rotated every week, that's what prevents it from growing. Did you turn off log rotation? Even so, on stable, I get about 100kB on a busy week with lots of updates, 5.9GB sounds like you've been running unstable for years and never rotated the log. – Gilles 'SO- stop being evil' Feb 9 '17 at 15:33

What sense does it make to log this? (...) I don't want to log useless information.

When there's a problem, or you don't remember what you did, you will hope that everything gets logged. ;)

Is there a way to disable it?

There's only a way I can think of. Disable logrotate for the logfile, and create a symbolic link to /dev/null. The manual doesn't include any other option.

| improve this answer | |

Please do not use symbolic links to /dev/null. Edit the main apt config file (/etc/apt/apt.conf) as explained by Gilles if you really do not wish to have any package history.

Note that /etc/apt/apt.conf may not yet exist on your system. In this case, the apt package executables use built-in defaults. So, you would have to create the file from scratch as part of the edits described by Gilles.

However, even doing this correctly is highly discouraged for recovery reasons:

  • System crash or lost power (E.g. thunderstorm) during apt-get. What package(s) are potentially damaged?
  • System or application behavior is no longer useful or acceptable. What was recently installed? I might need to remove some of them.

Good luck.

| improve this answer | |

One use for this file is looking to see if any extra information was printed out during the APT run (packages will do this in post_install.sh inside the package, most likely).

For information on how to disable it, see Gilles' answer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.