Page 1 of 1

apt-get log?

Posted: Thu Apr 24, 2008 5:42 pm
by alex.barylski
I've Googled and only found something sorta like what I would like ideally.

Basically I have been slowly configuring my server with all the nessecary daemons, etc and would like to print out a log so the next time I have to setup a server I can simply goes through a list so I'm sure not to miss anything.

I have tried:

Code: Select all

cat /var/log/dpkg.log
However this seems to dump more than what I need. Really I'm interested in apt-get commands issued at the CLI. I believe the commands you execute are cached (I can quickly recall previous commands using the arrow keys) so I'm wondering if I could run a grep on that cache file and only show the apt-get install commands I've executed???

Can someone show me how, please. :)

Re: apt-get log?

Posted: Thu Apr 24, 2008 5:50 pm
by VladSun
There is a file called .bash_history in every user's home directory - that's the "cache" file for shell commands.

Code: Select all

grep "apt-get install" /root/.bash_history
Keep in mind that only the last 500 (by default for Debian) CLI lines are saved.

Code: Select all

wc -l /root/.bash_history
PS: You owe me a beer ... no! two beers :)

Re: apt-get log?

Posted: Thu Apr 24, 2008 7:17 pm
by alex.barylski
PS: You owe me a beer ... no! two beers
I'll buy you a whole case when everything is setup and configured and working. :P