88

I would like to know where I can find the logs for the following package managers:

  • Synaptic Package Manager
  • Ubuntu Software Center
  • The logs when using the terminal with apt-get
Zanna
  • 70,465
sdale1930
  • 1,147
  • 2
  • 9
  • 11
  • 1
    none of the listed logs in the answers are very verbose. I think it would be nice to see something like:" downloading index from http://blah blah downloading deb http://blah installing package foo version 1.2.3 from file foo.blah.deb" instead of just lists of packages that were installed. – Brian Minton Jul 09 '14 at 19:47
  • http://askubuntu.com/questions/21657/show-apt-get-installed-packages-history-via-commandline – Ciro Santilli OurBigBook.com Nov 05 '15 at 21:40

4 Answers4

114

Apt logs can be found in /var/log/apt/term.log. To view them with GEdit you can use the command:

gedit /var/log/apt/term.log
David Foerster
  • 36,264
  • 56
  • 94
  • 147
nux
  • 38,017
  • 35
  • 118
  • 131
  • 1
    Could I use cat to view them? – sdale1930 Feb 25 '14 at 01:11
  • 5
    yes you can man – nux Feb 25 '14 at 01:13
  • 7
    Of course, cat /var/log/apt/term.log will display the file contents just fine. You may also be interested in tail -f /var/log/apt/term.log. This only displays the last few lines (tail) of the file, and, more interestingly, will continually print whatever gets appended to that file. This is quite interesting if you want to "observe" the log. – Malte Skoruppa Feb 25 '14 at 01:14
  • 11
    use lessso you can scroll easier. – sjas Jul 09 '14 at 14:53
53

I like /var/log/apt/history.log. It is very concise.

Also note that older logs are archived with logrotate once a month. To combine the current history.log and all the older compressed history.log files you can use cat and zcat like this:

cd /var/log/apt && cat history.log > ~/Desktop/allhistory.log && zcat history.log*gz >> ~/Desktop/allhistory.log && cd

Then you can, for example, use grep to find what you need:

$ grep package_name ~/Desktop/allhistory.log where you will put what you want in place of 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)

And, Bohr, in a comment, suggested using zgrep directly if one is searching for lines related to a specific package. This works for me assuming I'm searching both history.log and its existing archived files for smtube:

zgrep smtube /var/log/apt/history*
DK Bose
  • 42,548
  • 23
  • 127
  • 221
  • 2
    Or run zgrep directly. – Bohr Jun 29 '15 at 10:55
  • If you want your log in cronological order (I think it was just unintentional), the command should be rearranged: cd /var/log/apt && zcat history.log*gz > ~/Desktop/allhistory.log && cat history.log >> ~/Desktop/allhistory.log – topher217 Mar 04 '22 at 02:26
20

check the file

/var/log/dpkg.log

which records all the apt activities, such as installs or upgrades, for the various package managers

also you can view synaptic logs through its gui

Sagar Patni
  • 491
  • 2
  • 4
  • 10
0

You can use:

zcat /var/log/dpkg.log.*.gz | cat - /var/log/dpkg.log

or if you want less details:

zcat /var/log/dpkg.log.*.gz | cat - /var/log/dpkg.log | grep -E 'install |upgrade |remove '