list apt installed programs

C++
apt list --installedapt list --installed | grep program_name# Use aptitude to get packages which were expressly installed (not just as dependecies)
aptitude search '~i!~M'
Source

Also in C++: