I am trying to find a good method to find the repository for each package that was stored on my system that can be easily parsed.
Backstory:
I have Debian wheezy systems and have setup the wheezy-backports repository, so I could get a newer version of a package. I made a mistake with my patterns in the pinning configuration, which I didn't notice. I pinned *
for the backports repository. A few weeks later I issued a apt-get -y dist-upgrade
and wasn't paying attention and upgraded far more packages to the wheezy-backports then I was interested in.
I had backups, so I could easily restore things easily, but this situation made me really want to find a way to find which repository each package came from.
About the closest method I have found so far is like this. apt-cache policy $(dpkg -l | awk '/ii/ {print $2}' )
. Which is somewhat close, but ideally I would like to get a report like this for all the packages.
Package<tab>Version<tab>Origin<tab>Suite
Where Origin/Suite are the values from the repository Release files.
apt-show-versions
package be helpful?