Debian – How to uninstall all packages from one Debian source

aptdebianrepositoryuninstall

I previously added some external sources to /etc/apt/sources.list.d but I now want to remove one of them. I also want to:

  • remove all packages solely from that source
  • revert all packages to versions in my original source(s)
  • alternatively, make a list of all packages from this source so I can perform this procedure manually

How can I do this?

Best Answer

Depending on the configuration of the repository you wish to remove, apt list --installed might provide enough information to identify packages you need to uninstall or downgrade. Another option, if the repository defines a unique “Origin”, is to use aptitude search '~i ~Oorigin' (replacing origin as appropriate).

(This is a generic answer; if you edit your question to specify exactly which source you want to remove, I can add a specific answer.)

Related Question