This doesn't answer the question exactly: it rather gives a command to list all the apt install / apt-get install commands found in the logs1 along with some advices on how to parse the list further in order to exclude those run by Ubiquity, since the perfect solution for this task seems to not exist.
zcat /var/log/apt/history.log.*.gz | cat - /var/log/apt/history.log | grep -Po '^Commandline:(?= apt(-get)?)(?=.* install ) \K.*'
zcat /var/log/apt/history.log.*.gz: decompresses all the compressed apt logs in /var/log/apt, concatenates them and prints to stdout;
cat - /var/log/apt/history.log: appends /var/log/apt/history.log and prints to stdout;
grep -Po '^Commandline:(?= apt(-get)?)(?=.* install ) \K.*': selects only the lines starting with Commandline: apt or Commandline: apt-get containing install with a leading and trailing space and prints the remainder of each selected line to stdout;
This will output the list of all the apt install / apt-get install commands found in the logs1 (the only undesidered output could be an apt(-get)?-non-install command mentioning an install package, but that package doesn't exist (yet?), at least in the default repositories);
Note: In my installation (Ubuntu 15.04 64-bit), the first four commands listed are those run by Ubiquity during the installation; to exclude these, you may pipe the output to sed:
sed '1,4d'
So that the final approximate command for Ubuntu 15.04 64-bit would be:
zcat /var/log/apt/history.log.*.gz | cat - /var/log/apt/history.log | grep -Po '^Commandline:(?= apt(-get)?)(?=.* install ) \K.*' | sed '1,4d'
1: As of Ubuntu 22.04, /etc/logrotate.d/apt sets the rotation for /var/log/apt/history.log to run monthly, and enforces keeping a maximum of 12 rotated logs, making this useful (without making changes to /etc/logrotate.d/apt) to list all commands run in the last 12-13 months (including a month worth at most of commands listed in the un-rotated log).