How to tell which repositories provide which packages?
Little Girl
littlergirl at gmail.com
Wed Jan 6 17:33:10 UTC 2021
Hey there,
Ralf Mardorf via ubuntu-users wrote:
>Little Girl wrote:
>>apt-cache showpkg "*" | grep repo | grep File | awk -F " " '{print
>>$2}' | awk -F "." '{print $2}' | sort -u
>
>This one doesn't work for me.
Interesting. It works perfectly here and just lists off the names of
my PPAs.
>>Get the names of all packages installed by your PPA (replace XXXX in
>>this command with your source name):
>>
>>dpkg -l $(awk '$1 == "Package:" { print
>>$2 }' /var/lib/apt/lists/repo.XXXX*Packages) 2>/dev/null | grep ii |
>>awk '{print $2}'
>
>As already pointed out, the "grep ii" could lead to false positives.
Ah, yes. Okay, here's an updated version of it that's horrendously
long and probably badly coded, but works at my end (replace XXXX
with your source name):
apt-cache policy $(awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.XXXX*Packages) | grep -v
"Installed: (none)" -| grep -i "Installed: " -B1 | grep ':$'| sed
's/.$//' | sort -u
>>Or get the names and versions of all packages installed by XXXX
>>(replace XXXX in this command with your source name):
>>
>>apt-cache policy $(awk '$1 == "Package:" { print
>>$2 }' /var/lib/apt/lists/repo.XXXX*Packages) | grep -v
>>"Installed: (none)" | grep "Installed: " -B1
>
>I still would use this one and hope that we didn't miss a mistake. My
>impression is, that it works without a pitfall, but I might be
>mistaken.
It seems solid to me.
--
Little Girl
There is no spoon.
More information about the ubuntu-users
mailing list