How to get the history of “apt-get install” on Ubuntu

aptdpkg

I am about do move a server from one Ubuntu box to another. I'm not cloning the old box to the new; I'm creating a new system and will move data as needed. I want to install all the software that I have on the old box on the new one.

Is there a simple way to find the history of all the "sudo apt-get install" commands I have given over time? That is, dpkg -l shows me all the packages that have been installed, but not which top-level package installed them. If there is a way for dpkg to give me the installing package, I can find the unique ones there; otherwise, I want something else to say "you installed these 24 packages".

Best Answer

The apt history is in /var/log/apt/history.log as said in a comment above. That said, this will not list packages that were installed manually, using dpkg or GUIs such as gdebi. To see all the packages that went through dpkg, you can look at /var/log/dpkg.log.