Here are some examples that would help understanding the common usage of apt-log.
We are going to deal with dates and times: apt term.log is normally full of what apt-get outputs on the terminal and each action logged has associated a date and a time. Apt-log refers to them as entries.
Please note: apt-log accepts date and time expressed in ISO 8601 format (that is yyyy:mm:dd - hh:mm:ss) to be consistent with the format used by apt logs. Now start query for entries.


It is possible we are already interested in investigating some particular day,but let's consider a more general situation (for showing a wide range of case). For example we would know in which days of the year 2008 we had activities:

# apt-log 2008

On 2008 founded activities in follow months:

[1] 2008-08             [2] 2008-09             [3] 2008-10             [4] 2008-11

And then go investigate a month:

# apt-log 2008-10

On 2008-10 founded activities in follow days:

[1] 2008-10-02          [2] 2008-10-08          [3] 2008-10-23          [4] 2008-10-29

At this point a day as well:

# apt-log 2008-10-02

On 2008-10-02 founded the follow entries:

[1] 16:04:00

We can't actually go deeper as we have reached the entries,the basic units.It is possible just to show them:

# apt-log 2008-10-02 16:04:00

As seen, is natural going with a top-down approach with dates and times (year-->months-->days-->hours),and think them as containers.

It is also important to note that dates (year, month or day) can take arguments themselves.

For example is possible to specify more than one entries, to show some or all the entries of a specified day (see also the --deep option)

# apt-log 2008-10-02 16:04:00 22:36:00

Also years and months accept valid arguments :

# apt-log 2008 3 4 10
# apt-log 2008-10 2 6 28

Apt-log is flexible enough to take a general mix of dates and relative arguments in one line, even though the notation became quite noisy :

# apt-log 2008 3 4 10 2008-10 2 6 28 2008-10-02 16:04:00


The --deep option modify the standard behaviour of apt-log.If present, apt-log will output all the entries which belongs to given arguments.
For example:

# apt-log -d 2008-10
will go deep into his relative 4 days showing their relative entries.

The --changes option if present calculates and show packages' changes from a given date. It accepts as argument a valid date:

# apt-log --changes 2008

# apt-log --changes 2008-10

# apt-log --changes 2008-10-05

# apt-log --changes 2008-10-05 21:34:07

The --history option aims to show a package's history.It accepts as argument a Perl compatible regex:

# apt-log --history kde.*

The --status option aims to show a package's status.It accepts as argument a Perl compatible regex:

# apt-log --status gnome.*


Shows entries logged on february 2009:

apt-log 2009-02

Shows details of specific logged entries on 1st of february 2009:

apt-log 2009-02-01 11:58:00 14:23:01

Shows details of all logged entries on 1st of february 2009:

apt-log --deep 2009-02-01

Undo remove actions of entry 2009-02-06 15:51:19:

apt-log --raw --type="r" 2009-02-06 15:51:19 | xargs aptitude install

Shows packages' changes from 2009-02-15:

apt-log --changes 2009-02-15

To be finished...

Creative Commons License