apt get a list of all installed packages

Do this:

dpkg --get-selections | grep -v deinstall

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.