Sometimes you may want to know which repository or PPA is the source of a package on Ubuntu. More so when you have multiple PPAs added and more than one of those provide the same package. You may also want to know which repository provides the latest version. Use the apt-cache command for all these information. Here’s an example for SMPlayer on my system:
$ apt-cache policy smplayer smplayer: Installed: 220.127.116.1175-1~trusty1 Candidate: 18.104.22.16875-1~trusty1 Version table: *** 22.214.171.12475-1~trusty1 0 500 http://ppa.launchpad.net/rvm/testing/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status 126.96.36.19972-1~trusty1 0 500 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu/ trusty/main amd64 Packages 0.8.6-2 0 500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
As you can see from the above output, 3 repositories added in my system provide the package SMPlayer, with the latest version from rvm/testing ppa. The currently installed version is preceded by *** and the line below shows the repository which provides it.