see where package is installed ubuntu code example
Example 1: how to find installed packages in ubuntu
apt list --installed
Example 2: ubuntu see if package is installed
dpkg -l {package_name}
apt list --installed
dpkg -l {package_name}