How to tell which repositories provide which packages?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

How to tell which repositories provide which packages?

Chris Green
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.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Little Girl
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

--
Little Girl

There is no spoon.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Ian Bruntlett
Hi,

On Tue, 5 Jan 2021 at 20:31, Little Girl <[hidden email]> 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

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

Neat! Really useful, thank you :)

BW,

Ian


--
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Chris Green
In reply to this post by Little Girl
On Tue, Jan 05, 2021 at 03:29:17PM -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
>
These are all the wrong way round though.  I don't know the package
names, I want to know if (for example) if any packages have been
installed from:-
    http://ppa.launchpad.net/vincent-vandevyvre/vvv/ubuntu

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
In reply to this post by Little Girl
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.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Tue, 5 Jan 2021 22:01:57 +0100, Ralf Mardorf wrote:

>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

+ all packages containing "ppa" in their name.

>, 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.



--
“Awards are merely the badges of mediocrity.”

― Charles Ives

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Tue, 5 Jan 2021 22:08:08 +0100, Ralf Mardorf wrote:

>On Tue, 5 Jan 2021 22:01:57 +0100, Ralf Mardorf wrote:
>>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

oops, no already here packages and PPAs don't belong together ;)
 

>
>+ all packages containing "ppa" in their name.
>
>>, 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.  
>
>
>



--
“Awards are merely the badges of mediocrity.”

― Charles Ives

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Chris Green
In reply to this post by Little Girl
On Tue, Jan 05, 2021 at 03:29:17PM -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
>
This doesn't really tell me the truth:-

    chris@esprimo$ apt-cache policy '*' | grep syncthing
    syncthing:
    syncthing-relaysrv:
    golang-github-syncthing-syncthing-dev:
    golang-github-syncthing-notify-dev:
    syncthing-discosrv:
    chris@esprimo$ dpkg -l | grep syncthing
    ii  syncthing                             1.12.0
          amd64        Open Source Continuous File Synchronization
    chris@esprimo$

So apt-cache policy '*' returns things which either aren't package
names or aren't installed.


> 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.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Little Girl
In reply to this post by Chris Green
Hey there,

Chris Green wrote:

>These are all the wrong way round though.  I don't know the package
>names, I want to know if (for example) if any packages have been
>installed from:-
>    http://ppa.launchpad.net/vincent-vandevyvre/vvv/ubuntu

Whoops. My mistake. Here you go. I found this page:

https://askubuntu.com/questions/43581/how-to-list-packages-from-a-ppa-source-in-command-line

By following the steps in the first solution that the OP was offered,
I was able to come up with this example that shows me all packages
installed by the Vivaldi PPA on my system (note that this is a
one-line command, but it might wrap at your end):

awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.vivaldi*Packages

You'll need to go take a look in the /var/lib/apt/lists directory and
find all entries that contain your PPA name and end in "Packages".
Then edit the above command with a wildcarded path to that or those.

This might work, but I'm guessing at how the PPA is listed:

awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.vincent-vandevyvre*Packages

Or perhaps this might work:

awk '$1 == "Package:" { print
$2 }' /var/lib/apt/lists/repo.vincent*Packages

I don't have that PPA, so when I try to run either of those last
two commands, I get a fatal awk warning that the file or directory
doesn't exist. Your mileage may vary.

Also, there's more than one solution on that page, so if you'd prefer
something different, see what you think of the others.

--
Little Girl

There is no spoon.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Jim Byrnes-4
In reply to this post by Chris Green
On 1/5/21 3:41 PM, Chris Green wrote:

> On Tue, Jan 05, 2021 at 03:29:17PM -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
>>
> This doesn't really tell me the truth:-
>
>      chris@esprimo$ apt-cache policy '*' | grep syncthing
>      syncthing:
>      syncthing-relaysrv:
>      golang-github-syncthing-syncthing-dev:
>      golang-github-syncthing-notify-dev:
>      syncthing-discosrv:
>      chris@esprimo$ dpkg -l | grep syncthing
>      ii  syncthing                             1.12.0
>            amd64        Open Source Continuous File Synchronization
>      chris@esprimo$
>
> So apt-cache policy '*' returns things which either aren't package
> names or aren't installed.
>
>
>> 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.
>

I think the Synaptic  Package Manager will do so. Just click on the
Origin button. I don't have anything installed from a PPA on this
machine, but I am sure it showed them in the past.

Regards,  Jim


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Little Girl
In reply to this post by Ian Bruntlett
Hey there,

Ian Bruntlett 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
>>
>> 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

>Neat! Really useful, thank you :)

Any time. Command-line toys are always fun.

--
Little Girl

There is no spoon.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Little Girl
In reply to this post by ubuntu-users mailing list
Hey there,

Ralf Mardorf via ubuntu-users wrote:

>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,

That seems to list only packages that contain "ppa" in their names
rather than packages provided by a PPA.

>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.

Yep, those don't work for me, either.

>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.

I had sent a couple of possibilities for him in a previous email, but
have been tinkering with it since then so I can add it to my
ever-growing cheat sheet of common commands. This one shows all
packages installed by any PPA on the system rather than listing
packages from a specific PPA:

awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/repo.*Packages

I suppose that could come in handy at some point.

--
Little Girl

There is no spoon.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Little Girl
In reply to this post by Chris Green
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.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Tue, 5 Jan 2021 18:17:10 -0500, Little Girl wrote:
>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

You are mistaken, it does show all packages provided by the PPA, but
they aren't necessarily installed. It "seems" to work for a PPA that
just does provide one or a few packages, but not for PPAs with tons of
packages that aren't installed.

[weremouse@moonstudio ~]$ awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*obs-studio*amd64_Packages
obs-studio
[weremouse@moonstudio ~]$ awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages | head -1
albert
[weremouse@moonstudio ~]$ apt-cache policy obs-studio | grep In
  Installed: 25.0.8-0obsproject1~xenial
[weremouse@moonstudio ~]$ apt-cache policy albert | grep In
  Installed: (none)

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
In reply to this post by Little Girl
I guess this does the job:

apt-cache policy $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -E Installed:\ [[:digit:]] -B1

Replace "*webupd8*amd64" by the wanted PPA.




My last mail didn't come through the list:

Begin forwarded message:

Date: Wed, 6 Jan 2021 05:12:50 +0100
From: Ralf Mardorf
To: [hidden email]
Subject: Re: How to tell which repositories provide which packages?


On Tue, 5 Jan 2021 18:17:10 -0500, Little Girl wrote:
>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  

You are mistaken, it does show all packages provided by the PPA, but
they aren't necessarily installed. It "seems" to work for a PPA that
just does provide one or a few packages, but not for PPAs with tons of
packages that aren't installed.

[weremouse@moonstudio ~]$ awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*obs-studio*amd64_Packages
obs-studio
[weremouse@moonstudio ~]$ awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages | head -1
albert
[weremouse@moonstudio ~]$ apt-cache policy obs-studio | grep In
  Installed: 25.0.8-0obsproject1~xenial
[weremouse@moonstudio ~]$ apt-cache policy albert | grep In
  Installed: (none)

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Wed, 2021-01-06 at 05:35 +0100, Ralf Mardorf via ubuntu-users wrote:
> I guess this does the job:
>
> apt-cache policy $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -E Installed:\ [[:digit:]] -B1
>
> Replace "*webupd8*amd64" by the wanted PPA.

I don't know the policy for package versioning. Perhaps it's better to
replace "[:digit:]" by "[:alnum:]", juts in case it should be allowed to
start with a letter. The main point is to get rid of packages
"Installed: (none)". It's probably not allowed to start the versioning
with a char that is neither a number, nor a letter.

[weremouse@moonstudio ~]$ apt-cache policy $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -E Installed:\ [[:alnum:]] -B1
audacious:
  Installed: 3.10-1~webupd8~xenial0
--
audacious-plugins:
  Installed: 3.10-1~webupd8~xenial0
--
audacious-plugins-data:
  Installed: 3.10-1~webupd8~xenial0
--
libampache-browser:
  Installed: 0~git20160805-1~webupd8~xenial3
--
libaudcore5:
  Installed: 3.10-1~webupd8~xenial0
--
libaudgui5:
  Installed: 3.10-1~webupd8~xenial0
--
libaudqt2:
  Installed: 3.10-1~webupd8~xenial0
--
libaudtag3:
  Installed: 3.10-1~webupd8~xenial0
--
python-twodict:
  Installed: 1.2-1~webupd8~xenial0
--
youtube-dlg:
  Installed: 0.4-1~webupd8~xenial4


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Wed, 06 Jan 2021 05:58:41 +0100, Ralf Mardorf via ubuntu-users wrote:

>On Wed, 2021-01-06 at 05:35 +0100, Ralf Mardorf via ubuntu-users wrote:
>> I guess this does the job:
>>
>> apt-cache policy $(awk '$1 == "Package:" { print $2 }'
>> /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -E Installed:\
>> [[:digit:]] -B1
>>
>> Replace "*webupd8*amd64" by the wanted PPA.  
>
>I don't know the policy for package versioning. Perhaps it's better to
>replace "[:digit:]" by "[:alnum:]", juts in case it should be allowed
>to start with a letter. The main point is to get rid of packages
>"Installed: (none)". It's probably not allowed to start the versioning
>with a char that is neither a number, nor a letter.
>
>[weremouse@moonstudio ~]$ apt-cache policy $(awk '$1 == "Package:" {
>print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -E
>Installed:\ [[:alnum:]] -B1

Probably that's perfect:

apt-cache policy $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -v "Installed: (none)" | grep "Installed: " -B1

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
In reply to this post by ubuntu-users mailing list
Another idea, only listing the package names and nothing else, assuming
the Ubuntu flavour installs are x86_64 only nowadays.

One package per line...

[weremouse@moonstudio ~]$ dpkg -l $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) 2>/dev/null | grep ii | awk '{print $2}' | sed 's/:amd64//g'
audacious
audacious-plugins
audacious-plugins-data
libampache-browser
libaudcore5
libaudgui5
libaudqt2
libaudtag3
python-twodict
youtube-dlg

...or all packages by one line

[weremouse@moonstudio ~]$ echo $(dpkg -l $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) 2>/dev/null | grep ii | awk '{print $2}' | sed 's/:amd64//g')
audacious audacious-plugins audacious-plugins-data libampache-browser libaudcore5 libaudgui5 libaudqt2 libaudtag3 python-twodict youtube-dlg

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

ubuntu-users mailing list
On Wed, 6 Jan 2021 08:17:48 +0100, Ralf Mardorf wrote:

>Another idea, only listing the package names and nothing else, assuming
>the Ubuntu flavour installs are x86_64 only nowadays.
>
>One package per line...
>
>[weremouse@moonstudio ~]$ dpkg -l $(awk '$1 == "Package:" { print $2
>}' /var/lib/apt/lists/*webupd8*amd64_Packages) 2>/dev/null | grep ii |
>awk '{print $2}' | sed 's/:amd64//g' audacious audacious-plugins
>audacious-plugins-data
>libampache-browser
>libaudcore5
>libaudgui5
>libaudqt2
>libaudtag3
>python-twodict
>youtube-dlg
>
>...or all packages by one line
>
>[weremouse@moonstudio ~]$ echo $(dpkg -l $(awk '$1 == "Package:" {
>print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) 2>/dev/null |
>grep ii | awk '{print $2}' | sed 's/:amd64//g') audacious
>audacious-plugins audacious-plugins-data libampache-browser
>libaudcore5 libaudgui5 libaudqt2 libaudtag3 python-twodict youtube-dlg

"grep ii" is fishy, since a package tagged with "un" could include "ii"
in it's name:

[weremouse@moonstudio ~]$ dpkg -l $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) 2>/dev/null
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                      Version                   Architecture              Description
+++-=========================================-=========================-=========================-========================================================================================
ii  audacious                                 3.10-1~webupd8~xenial0    amd64                     small and fast audio player which supports lots of formats
ii  audacious-plugins:amd64                   3.10-1~webupd8~xenial0    amd64                     Base plugins for audacious
ii  audacious-plugins-data                    3.10-1~webupd8~xenial0    all                       Data files for Audacious plugins
ii  libampache-browser:amd64                  0~git20160805-1~webupd8~x amd64                     Ampache desktop client library
un  libaudcore3                               <none>                    <none>                    (no description available)
un  libaudcore4                               <none>                    <none>                    (no description available)
ii  libaudcore5:amd64                         3.10-1~webupd8~xenial0    amd64                     audacious core engine library
un  libaudgui3                                <none>                    <none>                    (no description available)
un  libaudgui4                                <none>                    <none>                    (no description available)
ii  libaudgui5:amd64                          3.10-1~webupd8~xenial0    amd64                     audacious media player (libaudgui shared library)
un  libaudqt0                                 <none>                    <none>                    (no description available)
un  libaudqt1                                 <none>                    <none>                    (no description available)
ii  libaudqt2:amd64                           3.10-1~webupd8~xenial0    amd64                     audacious media player (libaudqt shared library)
un  libaudtag2                                <none>                    <none>                    (no description available)
ii  libaudtag3:amd64                          3.10-1~webupd8~xenial0    amd64                     audacious media player (libaudtag shared library)
un  libvdpau-va-gl1                           <none>                    <none>                    (no description available)
ii  python-twodict                            1.2-1~webupd8~xenial0     all                       Simple two way ordered dictionary for Python
ii  youtube-dlg                               0.4-1~webupd8~xenial4     all                       youtube-dl gu

So far the best solution still is

apt-cache policy $(awk '$1 == "Package:" { print $2 }' /var/lib/apt/lists/*webupd8*amd64_Packages) | grep -v "Installed: (none)" | grep "Installed: " -B1

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to tell which repositories provide which packages?

Chris Green
In reply to this post by Little Girl
On Tue, Jan 05, 2021 at 06:17:10PM -0500, Little Girl wrote:

> 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

Syncthing has a repository, see:-

    https://syncthing.net/downloads/

It's possibly not a 'proper' PPA but it certainly works well and keeps
syncthing up to date on my systems.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
123