You are not logged in.

#1 2007-08-13 22:10:33

sula
Member
Registered: 2005-08-07
Posts: 93

List of already installed packages?

Hi ,i have a question. I know i have installed some unnedded packages on my system ,some of them do not exist in repos anymore , and i don't know their exact names and can't find them by -Ss option. So is there a way to obtain list of packages or better search by name for packages already installed on my system (preferably those from aur also)
Thank you in advance smile

Offline

#2 2007-08-13 22:14:51

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: List of already installed packages?

pacman -Q

is what you're looking for.. Try pacman -Qh for some help wink

EDIT: As for AUR, pacman -Q works with all packages installed locally using pacman, including those from AUR, or any other source (even self-made). They are, however, (afaik) undistinguished from "official" packages.

-miky

Last edited by mr.MikyMaus (2007-08-13 22:17:22)


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#3 2007-08-13 23:16:11

Cilyan
Member
From: Toulouse (FR)
Registered: 2006-08-27
Posts: 97
Website

Re: List of already installed packages?

$ pacman -Qi

gives you a list of installed packages and

$ pacman -Sl

gives you a list of all the packages that are available on repositories. Packages built from aur are listed as installed package.

You can give a look at

$ pacman -Qe

which lists orphan packages, that mean, packages that are not required by any other package.

Here is a command to get every package that is not on any repository. It includes no more maintained package and manually compiled packages.

pacman -Qi | awk '{print $1}' | sed -r "s/$/#/g" | sed -r "s/(`pacman -Sl | awk '{print $2}' | sed -r "s/$/#/g" | tr '\n'  '|' | sed -r 's/|$//g'`)//g" | grep "#" | sed "s/#//g"

It retreive a list of existing packages, form a regular expression with it and parse with sed the list of installed package to suppress every package that match. A "#" is added at the end of each item to parse it completely and not just a part (i.e.: gstreamer-0.10 would match gstreamer-0.10-amrnb). It is removed at the end. the last grep filter only good line, neither empty item nor partially parsed one. This could be improved but it was just for fun !

Hope it will help.

Offline

#4 2007-08-14 08:12:55

sula
Member
Registered: 2005-08-07
Posts: 93

Re: List of already installed packages?

thank you both very much smile

Offline

#5 2007-08-14 09:14:02

Husio
Member
From: Europe
Registered: 2005-12-04
Posts: 359
Website

Re: List of already installed packages?

pacman -Qi | awk '{print $1}' | sed -r "s/$/#/g" | sed -r "s/(`pacman -Sl | awk '{print $2}' | sed -r "s/$/#/g" | tr '\n'  '|' | sed -r 's/|$//g'`)//g" | grep "#" | sed "s/#//g"

vs

pacman -Qm
pacman -Qm | awk '{print $1}'

pacman -Qh | grep m,
wink

Last edited by Husio (2007-08-14 09:17:50)

Offline

#6 2007-08-14 09:34:39

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: List of already installed packages?

Cilyan wrote:

Here is a command to get every package that is not on any repository. It includes no more maintained package and manually compiled packages.

You mean pacman -Qm ?
The output is not exactly the same though, some packages are only in -Qm output, and others are only in the output of your script, so it may have a few bugs left.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2007-08-14 16:41:52

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: List of already installed packages?

I believe there are some useful utilities in AUR, which just may do something similar, among other things. "Pactools" is the package name wink

-m.


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

Board footer

Powered by FluxBB