kubicle mentioned the use of zgrep here in the context of searching dpkg's logs.
I use this small yad script
which, thanks to input from jlittle and kubicle, is much better than what I posted originally!
But
it requires the exact package name
and
the archived logs should still be in /var/log
To make the second condition more likely, I've bumped up the retention of logs (/var/log/apt/history.log and /var/log/dpkg.log) from the default rotate 12 to rotate 60.
I use this small yad script
Code:
#!/bin/bash package_name="$(yad --center --width=300 --title "Search dpkg logs" --entry --entry-label="Enter the exact package_name:" 2>/dev/null)" zgrep -E "status (not-)?installed $package_name:" /var/log/dpkg.log* | sed 's/:/: /' | sort -k2,3 -r | column -t
Code:
#!/bin/bash package_name="$(yad --center --width=300 --title "Search dpkg logs" --entry --entry-label="Enter the exact package_name:" 2>/dev/null)" zgrep -e "status installed $package_name:" /var/log/dpkg.log* > /tmp/zgrep.txt zgrep -e "status not-installed $package_name:" /var/log/dpkg.log* >> /tmp/zgrep.txt cat /tmp/zgrep.txt | sort -k4 sleep 1s rm /tmp/zgrep.txt
But
it requires the exact package name
and
the archived logs should still be in /var/log
To make the second condition more likely, I've bumped up the retention of logs (/var/log/apt/history.log and /var/log/dpkg.log) from the default rotate 12 to rotate 60.
Comment