Best way to determine if ROS is installed

Could you look at where the packages on the system came from (e.g. APT-Sources in apt show) and warn on packages that didn’t come from a repo known to support dist-upgrades?