On systems using apt: How do I get to know whether an installed package came from main, contrib or non-free? 
How do I get to know where a package came from?
apt;package management
It isapt-cache policy PACKAGEbetween release and architecture.