Fedora and general Linux Question: How do I find out if a certain package is intalled or not?

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
yum list package-name

or

yum info package-name

for a few more details
 

statik213

Golden Member
Oct 31, 2004
1,654
0
0
Originally posted by: kamper
yum list package-name

or

yum info package-name

for a few more details

thx, but does this work for packages that are not available via yum?

 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Yes, if it's installed. That brings something else to mind. Try yum list installed package-name which will actually execute much faster. It will not show any output if the package isn't installed but will work the same if it is installed. The difference is that it doesn't have to search the entire repository for potential matches.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
'rpm -qa | grep packagename' will show you whether you installed it via yum or not.

Since Debian uses dpkg for the low-level package manager you sould need 'dpkg -l *packagename*' and the first column will be status, ii means installed.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: Nothinman
'rpm -qa | grep packagename' will show you whether you installed it via yum or not.
That runs significantly slower than yum, at least on my machine.
Since Debian uses dpkg for the low-level package manager you sould need 'dpkg -l *packagename*' and the first column will be status, ii means installed.
What does that have to do with his question?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
That runs significantly slower than yum, at least on my machine.

Then you must have a huge RPM database, I've never seen it take more than 1-2s and yum is always slow as hell.

What does that have to do with his question?

The "and general Linux Question" part.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: Nothinman
That runs significantly slower than yum, at least on my machine.

Then you must have a huge RPM database, I've never seen it take more than 1-2s and yum is always slow as hell.
$ time rpm -qa | grep amsn
amsn-0.94-1.2.fc4.rf
amsn-skins-0.91-1.0.rf

real 0m20.084s
user 0m10.328s
sys 0m0.157s

$ time yum list installed "*amsn*"
Installed Packages
amsn.i386 0.94-1.2.fc4.rf installed
amsn-skins.noarch 0.91-1.0.rf installed

real 0m3.370s
user 0m1.613s
sys 0m0.312s

$ time yum list "*amsn*"
Setting up repositories
Reading repository metadata in from local files
Installed Packages
amsn.i386 0.94-1.2.fc4.rf installed
amsn-skins.noarch 0.91-1.0.rf installed

real 0m16.963s
user 0m6.096s
sys 0m0.438s

rpm is very much the slowest here. This is a p4@1.4, also crunching seti.
What does that have to do with his question?

The "and general Linux Question" part.
Gotcha.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I don't have a FC box to test for myself, so I'll have to take your word for it.

And somehow dpkg is 3x faster than RPM and it uses a plain text file instead of a database =)

time dpkg -l '*xserver-*' | grep ^ii
ii xserver-common 6.8.2.dfsg.1-5 files and utilities common to all X servers
ii xserver-xorg 6.8.2.dfsg.1-5 the X.Org X server

real 0m1.215s
user 0m0.708s
sys 0m0.078s