我喜欢var/log/apt/history.log。非常简洁。
另请注意,较旧的日志logrotate每月存档一次。要结合当前history.log和所有旧压缩history.log就可以使用文件cat和zcat这样的:
cd /var/log/apt && cat history.log > ~/Desktop/allhistory.log && zcat history.log*gz >> ~/Desktop/allhistory.log && cd
然后,您可以使用grep来查找所需的内容:
$ grep package_name ~/Desktop/allhistory.log您将在其中放置所需内容的位置package_name。
$ grep google ~/Desktop/allhistory.log
Upgrade: google-chrome-stable:amd64 (32.0.1700.102-1, 33.0.1750.117-1)
Upgrade: google-chrome-stable:amd64 (31.0.1650.48-1, 32.0.1700.77-1)
Upgrade: google-chrome-stable:amd64 (32.0.1700.77-1, 32.0.1700.102-1)
Upgrade: google-chrome-stable:amd64 (30.0.1599.101-1, 31.0.1650.48-1)
$
而且,Bohr在评论中建议zgrep如果要搜索与特定程序包相关的行,则直接使用。假设我要同时搜索history.log其及其现有的归档文件以查找smtube:
zgrep smtube /var/log/apt/history*