Here is the command which will show all the installed packages in your Debian/Ubuntu
sudo dpkg --get-selections
In order to download a text file of all the installed packages execute this command
sudo dpkg --get-selections > /home/mahesh/Downloads/list.txt
sudo dpkg --get-selections
In order to download a text file of all the installed packages execute this command
sudo dpkg --get-selections > /home/mahesh/Downloads/list.txt