How to tell which repositories provide which packages?
Ralf Mardorf
kde.lists at yahoo.com
Tue Jan 5 21:01:57 UTC 2021
On Tue, 5 Jan 2021 15:29:17 -0500, Little Girl wrote:
>Hey there,
>
>Chris Green wrote:
>
>>Is there a way to tell from which repositories packages have been
>>installed?
>>
>>I particularly want to see if I have any packages installed from a
>>particular PPA.
>
>This will give you your installed version, the candidate version
>that's available (if any), and the sources for the various versions:
>
>apt-cache policy PACKAGENAME
>
>If you're feeling frisky, either of these will probably give you way
>more information that you need, but can be good to keep in your back
>pocket:
>
>dpkg -s PACKAGENAME
>
>apt-cache showpkg PACKAGENAME
It's not that easy.
For example
apt-cache policy '*' | grep ppa
shows all packages provided by a ppa and to what ppa they belong to, so
'*' must be replaced by the output of a script, that lists only all
installed packages, something like e.g.
apt list --installed | cut -d/ -f1
However, something like
apt-cache policy $(apt list --installed | cut -d/ -f1) | grep ppa
won't do the job, since it does list packages containing 'ppa' that
don't belong to any PPAs, while PPAs are shown without the installed
packages that belongs to them. It's possible to solve this issue,
either by investing some time in writing a script or perhaps by
googling for scripts that already do exist.
AFAIK there's no command available, that does what the OP wants to get.
More information about the ubuntu-users
mailing list