FreeBSD - Tutorials, Security
Home   Archives   Sitemap   About   Contact

How to check if an rpm package is installed on a Red Hat Linux server

Home NEW! Unix Forum News 100 Tips and Tricks Website Development Server Operating Systems Databases
 Ivorde.ROarrow Server Operating Systems arrowAdministration GuidesarrowHow to check if an rpm package is installed on a Red Hat Linux server 

Article Sections

    Hello, Guest !
User name:
Password:
 
Google

 SATELLITE INTERNET
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 Distrowatch
 FreeBSD Handbook


Apache Webserver Home Page

Blog, intrebari si raspunsuri despre Leasing

Posted on: 22 Jan 2008
Author: mandrei
Section: Server Operating Systems | Administration Guides
Views: 12631
Comments: 1 (Add)

How to check if an rpm package is installed on a Red Hat Linux server
rpm check, check if package is installed, red hat linux

 



Maintaining a server up-to-date requires regular rpm checks.

Each time Red Hat releases a newer version of, for example, samba rpm (and requisites) with fixes for known vulnerabilities one needs to check if your server already has that rpm installed and which version, to compare it with the new released one (in the case when you have under administration more servers).

How to check if an rpm package is installed on a Red Hat Linux server

$ rpm -qa | grep samba
samba-common-3.0.9-1.3E.14.1
samba-3.0.9-1.3E.14.1
samba-client-3.0.9-1.3E.14.1

Taking a look at man rpm we'll se that -q  queries and -a queries all packages:

$ man rpm
SYNOPSIS
   QUERYING AND VERIFYING PACKAGES:
       rpm {-q|--query} [select-options] [query-options]

       rpm {-V|--verify} [select-options] [verify-options]

       rpm --import PUBKEY ...

       rpm {-K|--checksig} [--nosignature] [--nodigest]
           PACKAGE_FILE ...
..............................................................
   select-options
        [PACKAGE_NAME] [-a,--all] [-f,--file FILE]
        [-g,--group GROUP] {-p,--package PACKAGE_FILE]
        [--fileid MD5] [--hdrid SHA1] [--pkgid MD5] [--tid TID]
        [--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME]
        [--whatprovides CAPABILITY] [--whatrequires CAPABILITY]
   query-options
        [--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
        [--filesbypkg] [-i,--info] [--last] [-l,--list]
        [--obsoletes] [--provides] [--qf,--queryformat QUERYFMT]
        [-R,--requires] [--scripts] [-s,--state]
        [--triggers,--triggerscripts]

The result of the commands shows us that samba rpm and requisites are installed on our server.

You can replace samba with the rpm package you need and play a little with grep and regular expressions to limit the results of the command depending on the desired rpm name.

Bookmarks: Echo "How to check if an rpm package is installed on a Red Hat Linux server" around:
del.icio.usdiggFurlYahooMyWebGoogleBookmarksFaceBookTechnocratti
Access denied for user 'ivorde_ro'@'localhost' to database 'ivorde_ro_adv'