LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 05-03-2009, 12:13 PM   #1
redhatwannabe
Member
 
Registered: Dec 2008
Posts: 41

Rep: Reputation: 15
How do I know if a package/list of package is installed


Hi,

How do I know if a package/list of package is installed?

is it rpm -q -qf?

or is there other commands as well? thanks
 
Old 05-03-2009, 12:49 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
What does your man page say about -qf ?

Mine suggests that it queries which package the file
given as an argument to -qf belongs to; so that would
make the answer to
Quote:
is it rpm -q -qf?
a no.



Cheers,
Tink
 
Old 05-03-2009, 02:19 PM   #3
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 171Reputation: 171
It always helps if you tell us the distro, version, and arch you are running.

On yum based distros 'yum info package' will get the job done.
 
Old 05-03-2009, 03:30 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
I'm assuming Redhat or Fedora. If you are restricted to the command line, then use rpm or Yum (yum not available on real old versions of Redhat). If in a graphical environment, install Yumex ('yum install yumex').

rpm -qa | grep <partofpackagename>
rpm -qa <package or package wildcard>

These are also helpful to give you info on specific packages:
rpm -qi <package>
rpm -ql <package>

A few examples:
Code:
[root@athlonz ~]# rpm -qa | grep gcc
gcc-gfortran-4.3.0-8.x86_64
libgcc-4.3.0-8.x86_64
gcc-c++-4.3.0-8.x86_64
gcc-4.3.0-8.x86_64
libgcc-4.3.0-8.i386

[root@athlonz ~]# rpm -qa | grep grep
grep-2.5.1-59.fc9.x86_64

[root@athlonz ~]# rpm -qa gcc
gcc-4.3.0-8.x86_64

[root@athlonz ~]# rpm -qa gcc gcc-gfortran grep
grep-2.5.1-59.fc9.x86_64
gcc-gfortran-4.3.0-8.x86_64
gcc-4.3.0-8.x86_64

[root@athlonz ~]# rpm -qa gcc* gre*
grep-2.5.1-59.fc9.x86_64
gcc-gfortran-4.3.0-8.x86_64
gcc-c++-4.3.0-8.x86_64
gcc-4.3.0-8.x86_64

[root@athlonz ~]# rpm -qi gcc* gre*
package gcc* is not installed
package gre* is not installed

[root@athlonz ~]# rpm -qi gcc
Name        : gcc                          Relocations: (not relocatable)
Version     : 4.3.0                             Vendor: Fedora Project
Release     : 8                             Build Date: Mon 28 Apr 2008 05:07:29 PM EDT
Install Date: Tue 10 Mar 2009 07:15:06 AM EDT      Build Host: hammer2.fedora.redhat.com
Group       : Development/Languages         Source RPM: gcc-4.3.0-8.src.rpm
Size        : 17793711                         License: GPLv3+ and GPLv2+ with exceptions
Signature   : DSA/SHA1, Tue 29 Apr 2008 10:03:16 AM EDT, Key ID b44269d04f2a6fd2
Packager    : Fedora Project
URL         : http://gcc.gnu.org
Summary     : Various compilers (C, C++, Objective-C, Java, ...)
Description :
The gcc package contains the GNU Compiler Collection version 4.3.
You'll need this package in order to compile C code.

[root@athlonz ~]# rpm -ql gcc
/usr/bin/c89
/usr/bin/c99
/usr/bin/cc
/usr/bin/gcc
/usr/bin/gcov
/usr/bin/protoize
/usr/bin/unprotoize
/usr/bin/x86_64-redhat-linux-gcc
/usr/lib/gcc
/usr/lib/gcc/x86_64-redhat-linux
...
 
Old 05-03-2009, 03:46 PM   #5
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
And as suggested by lazlow, 'yum info package' (if you have yum repositories - we didn't have them until quite recently in work.)

Code:
[root@athlonz ~]# yum info gcc* grep
Loaded plugins: refresh-packagekit
Installed Packages
Name       : gcc
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 17 M
Repo       : installed
Summary    : Various compilers (C, C++, Objective-C, Java, ...)
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: The gcc package contains the GNU Compiler Collection version 4.3.
           : You'll need this package in order to compile C code.

Name       : gcc-c++
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 9.6 M
Repo       : installed
Summary    : C++ support for GCC
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: This package adds C++ support to the GNU Compiler Collection.
           : It includes support for most of the current C++ specification,
           : including templates and exception handling.

Name       : gcc-gfortran
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 11 M
Repo       : installed
Summary    : Fortran 95 support
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: The gcc-gfortran package provides support for compiling Fortran 95
           : programs with the GNU Compiler Collection.

Name       : grep
Arch       : x86_64
Version    : 2.5.1
Release    : 59.fc9
Size       : 454 k
Repo       : installed
Summary    : The GNU versions of grep pattern matching utilities
URL        : http://www.gnu.org/software/grep/
License    : GPL
Description: The GNU versions of commonly used grep utilities.  Grep searches
           : through textual input for lines which contain a match to a specified
           : pattern and then prints the matching lines.  GNU's grep utilities
           : include grep, egrep and fgrep.
           : 
           : You should install grep on your system, because it is a very useful
           : utility for searching through text.

Available Packages
Name       : gcc-gnat
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 13 M
Repo       : fedora
Summary    : Ada 95 support for GCC
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: GNAT is a GNU Ada 95 front-end to GCC. This package includes development tools,
           : the documents and Ada 95 compiler.

Name       : gcc-java
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 3.3 M
Repo       : fedora
Summary    : Java support for GCC
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: This package adds support for compiling Java(tm) programs and
           : bytecode into native code.

Name       : gcc-objc
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 3.3 M
Repo       : fedora
Summary    : Objective-C support for GCC
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: gcc-objc provides Objective-C support for the GCC.
           : Mainly used on systems running NeXTSTEP, Objective-C is an
           : object-oriented derivative of the C language.

Name       : gcc-objc++
Arch       : x86_64
Version    : 4.3.0
Release    : 8
Size       : 3.5 M
Repo       : fedora
Summary    : Objective-C++ support for GCC
URL        : http://gcc.gnu.org
License    : GPLv3+ and GPLv2+ with exceptions
Description: gcc-objc++ package provides Objective-C++ support for the GCC.
 
Old 05-04-2009, 12:57 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,217

Rep: Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378
  • The Package list :
  • rpm -qa | sort > my_installed_packages.txt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying installed package list to other systems tweak13 Suse/Novell 2 02-26-2007 06:29 PM
Slack Installed Package List rhb327 Slackware 3 08-29-2006 06:27 AM
List the files installed by a RPM package s_deepak_123 Linux - General 6 02-20-2006 12:14 PM
message "Problem during installation: x package needed for (installed) x package frayed2 Linux - Newbie 1 04-24-2005 07:05 PM
Does apt-get install <package> upgrade the package if it is already installed? davidas Debian 4 04-05-2004 06:12 PM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration