apt list --installed
Source: https://linuxconfig.org/list-installed-packages-with-apt-command
sudo apt clean --dry-run
Then:
sudo apt clean
Source: https://www.ubuntumint.com/clean-apt-cache/
dpkg -S /bin/ls
Source: https://askubuntu.com/questions/481/how-do-i-find-the-package-that-provides-a-file