/etc/apt/sources.list contains the links to the packet sources
sudo dpkg-query -l to see what packages are installed
sudo dpkg-query -l | grep <packagename> for a specific package
sudo apt-get install --simulate dbus-x11 shows what happen when installed inclusive dependencies
sudo apt-get install mc to install midnight commander
sudo apt search <packagename> to see what package can be or is installed. If the word automatic appears, then it got installed as a dependency
remove sudo apt-get remove --auto-remove <packagename> and sudo apt-get purge <packagename> and sudo reboot.
apt-show-versions -a <packetname> shows versions available, installed apt-show-versions might have to be installed first
If the package is not in the repository and just available as *.deb file do with checking and installing dependencies:
sudo apt install ./<package>.deb
Or without
sudo dpkg -i <package>.deb
dpkg -L <package>.deb shows what directories and files got installed