Page 1 of 1

[SOLVED] how can I see if a package is installed or not?

PostPosted: Feb 13th, '14, 20:28
by th3l0nius
Code: Select all
urpmq -i kernel-source-latest
shows for example lots of information aubout that package, but how can i figure out if it is already installed or not?

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 13th, '14, 20:49
by nightshadow
You could check in 'Install & remove software'.

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 13th, '14, 20:50
by jkerr82508
Code: Select all
rpm -qa | grep kernel-source

Will list any installed packages whose names include "kernel-source". If there are none it simply returns to the prompt.

As a general rule use urpmq to query the available packages in the repositories (both installed and not installed).
Use "rpm -q" to query the database of installed packages (which may or may not be in the repositories).

Jim

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 13th, '14, 22:22
by doktor5000
Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 14th, '14, 10:26
by th3l0nius
doktor5000 wrote:Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks

Sorry, but [SOLVED] doesn't fit in the subject line field.

Maybe the Topic Solved modfication should be installled here.

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 14th, '14, 11:35
by th3l0nius
jkerr82508 wrote:
Code: Select all
rpm -qa | grep kernel-source

Will list any installed packages whose names include "kernel-source". If there are none it simply returns to the prompt.

As a general rule use urpmq to query the available packages in the repositories (both installed and not installed).
Use "rpm -q" to query the database of installed packages (which may or may not be in the repositories).


Thank you for the answer..Usually I need both and it would be nice to could do it in one go. (For example checking what is the mageia name of the readline package and is it installed.)

And I need a command-line or at least shell-based program to do this. On Debian based systems aptitude allows for regex searches and on RedHat based ones yum lists by case-insensitive wildcarded search strings. Both show immediately wether a package is already installed.

As a trade-off I'll put something like this in a function:
Code: Select all
urpmq -Y readline | tee >(grep --color=always -f - <(rpm -qa))

Re: urpmq - how can I see if a package is installed or not?

PostPosted: Feb 14th, '14, 21:14
by doktor5000
th3l0nius wrote:
doktor5000 wrote:Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks

Sorry, but [SOLVED] doesn't fit in the subject line field.

It does :D

The mod is already on our wishlist - since ages :/