To get a list of all installed packages on a Debian or Ubuntu server, run the command:
This command will show you a rather long list. To save the list to a file, use this command:
dpkg --get-selections > /tmp/packages.txt
the list is saved then in the file /tmp/packages.txt.
If you seek for a specific package, use the grep command:
dpkg --get-selections | grep nginx
will show you all packages that contain the word "Nginx" in their name.
root@sv1:/# dpkg --get-selections | grep nginx nginx-common install nginx-extras install