How To Query Packages on a ledger

Is there a way to query or get a list all the dars and their package ids that have been deployed on the ledger?

The Package Service provides you with a ListPackages endpoint.