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

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

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

Postby th3l0nius » Feb 13th, '14, 20:28

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?
Last edited by doktor5000 on Feb 14th, '14, 21:13, edited 1 time in total.
Reason: adjusted thread title, marked SOLVED
th3l0nius
 
Posts: 6
Joined: Feb 4th, '14, 12:14

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

Postby nightshadow » Feb 13th, '14, 20:49

You could check in 'Install & remove software'.
nightshadow
 
Posts: 38
Joined: Dec 12th, '13, 23:35

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

Postby jkerr82508 » Feb 13th, '14, 20:50

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
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

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

Postby doktor5000 » Feb 13th, '14, 22:22

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby th3l0nius » Feb 14th, '14, 10:26

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.
th3l0nius
 
Posts: 6
Joined: Feb 4th, '14, 12:14

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

Postby th3l0nius » Feb 14th, '14, 11:35

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))
th3l0nius
 
Posts: 6
Joined: Feb 4th, '14, 12:14

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

Postby doktor5000 » Feb 14th, '14, 21:14

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 :/
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest