You are not logged in.

#1 2009-03-11 23:29:24

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,416
Website

pacman query option/list installed packages AND repos they came from

Is there a way I can have pacman query my set of installed packages and which repo they came from?  For example: pacman -Q returns a list of all my installed packages.  I'd like to have the same list but also showing me which repo the given package came from (i.e. core, extra, etc.)

Last edited by graysky (2009-03-11 23:31:26)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#2 2009-03-11 23:55:00

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: pacman query option/list installed packages AND repos they came from

Seemed to kill my machine when I did it but:

for i in $(pacman -Qq); do pacman -Ss ^$i$; done

There may be a way to do it natively, if so, the man page should say.

Last edited by rson451 (2009-03-11 23:56:23)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#3 2009-03-12 00:01:39

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,632
Website

Re: pacman query option/list installed packages AND repos they came from

Not the most efficient, but both seem to work:

 LIST=$(pacman -Sl); for ARG in $(pacman -Qq); do echo "$LIST" | grep " $ARG "; done
for ARG in $(pacman -Qq); do echo -n "$ARG : "; echo $(pacman -Si $ARG 2>/dev/null | head -n1 | cut -d ':' -f2); done

*edit*
My 1000th post... have I unlocked anything?

Last edited by Xyne (2009-03-12 00:06:56)

Offline

#4 2009-03-12 00:06:32

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,358
Website

Re: pacman query option/list installed packages AND repos they came from

There is no native way to do this, but you can use "paclist" in pacman-contrib to see what packages you have installed from a given repo.  I use it to keep track of the packages I install from [testing].

Offline

#5 2009-03-12 00:07:44

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,358
Website

Re: pacman query option/list installed packages AND repos they came from

Xyne wrote:

My 1000th post... where's my cookie?

The best I can do for you is to ban you for a day so you can celebrate the breaking of you addiction.

Offline

#6 2009-03-12 00:07:50

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,416
Website

Re: pacman query option/list installed packages AND repos they came from

Cool!  Thank you very much for the post, rson451, but it's not achieving the effect I was after... let me explain.  I have the three official arch repos in my /etc/pacman.conf but I also have some 3rd party repos in there too.  I want a way to list all the packages I have installed and where they came from so I can figure out which of them are from the official repo and which are from the 3rd party repo.  Some of them have the same name which is why I want to see the package name, and the repo from which it came.

I know about the -Qm switch, and if I comment out the 3rd party repo, then update pacman (-Sy) and use the (-Qm) switch it will show me which packages didn't come from the official arch repo... but that doesn't catch those packages with the same name that may have come from the 3rd party repo!

Anyone?

Last edited by graysky (2009-03-12 00:08:56)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#7 2009-03-12 00:13:40

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,416
Website

Re: pacman query option/list installed packages AND repos they came from

Xyne wrote:

Not the most efficient, but both seem to work:

 LIST=$(pacman -Sl); for ARG in $(pacman -Qq); do echo "$LIST" | grep " $ARG "; done

This works I think... I can load the output into a spreadsheet and sort it.

Thank you!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#8 2009-03-12 00:15:29

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,632
Website

Re: pacman query option/list installed packages AND repos they came from

Allan wrote:

The best I can do for you is to ban you for a day so you can celebrate the breaking of you addiction.

I expected a reply along those lines. You also quoted me within the 20 second window of re-editing my post.
*sigh*
I probably should stop keeping the forum on a tab most of the time.

graysky wrote:

...but that doesn't catch those packages with the same name that may have come from the 3rd party repo!

I think the problem is that once the package is on your system, pacman doesn't know or care where it came from, so I don't think it's possible.

Offline

#9 2009-03-12 00:19:05

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,416
Website

Re: pacman query option/list installed packages AND repos they came from

Xyne wrote:

I think the problem is that once the package is on your system, pacman doesn't know or care where it came from, so I don't think it's possible.

I think as long as the repo has a unique name I can use your method to generate the lists.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#10 2010-06-30 16:48:59

martinbaselier
Member
Registered: 2010-06-30
Posts: 6

Re: pacman query option/list installed packages AND repos they came from

Since this post came somewhere on the top of my Google search, I'd like to present a simple alternative solution, even though this topic is quite old.
yaourt -Q
does exactly what the OP asked for. The only thing is that you would need to install yaourt.

Offline

Board footer

Powered by FluxBB