How to tell which repositories provide which packages?
Little Girl
littlergirl at gmail.com
Tue Jan 5 23:17:10 UTC 2021
Hey there,
Chris Green wrote:
>Little Girl wrote:
>> 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
>>
>This doesn't really tell me the truth:-
You're right. It apparently only works on packages that aren't
installed by PPAs.
I looked up Syncthing and it hasn't got an official PPA, so you'll
want to look in Synaptic or /etc/apt/sources.list
or /var/lib/apt/lists to find out what the repository name is. Then
you can run this command, replacing REPOSITORYNAME with the specific
name for the PPA for that program:
awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.REPOSITORYNAME*Packages
>> 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
>>
>Neither of these seems to show anything about the PPA.
The second one gives me some PPA information for the Vivaldi PPA when
I do this:
apt-cache showpkg vivaldi-stable
The "File" lines were the results I was after, so I refined the
command a bit:
apt-cache showpkg vivaldi-stable | grep File
That uses the "vivaldi-stable" package name to give me the repository
information I needed for use in the above command.
So, to recap, if I have a package name, I can use it in this command
to get its PPA name, which is right after "repo" in the results:
apt-cache showpkg PACKAGENAME | grep File
Then I can follow that by inserting the repository name I got from
that command into this command to get all the packages installed by
that PPA:
awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.REPOSITORYNAME*Packages
--
Little Girl
There is no spoon.
More information about the ubuntu-users
mailing list