Does Debian or Ubuntu have a means of logging apt/aptitude commands?
I could also ask the same about yum commands in Redhat?
Do they have a history file?
You'll find quite a bit of apt logs under /var/log/apt/
(Not exactly about commands being run. More about actions being taken.)
Yes, you should look at /var/log/apt/history.log. But you might find more details in /var/log/dpkg.log.
/var/log/apt/history.log
/var/log/dpkg.log