[x]
Ever Worried about Missed / Lost Mobile Phone (or) Mobile Phone Theft ?
Use GinGly to Save your Mobile Numbers and Useful Messages
Limited Time Free Access .Hurry Up !!!


Login with username, password and session length
Resend Activation Email | Forgot your Password?
Join IT Acumens Discussion Zone Free!

Share this topic on FacebookShare this topic on MySpaceShare this topic on Del.icio.usShare this topic on DiggShare this topic on RedditShare this topic on StumbleUponShare this topic on TwitterShare this topic on TechnoratiShare this topic on MagnoliaShare this topic on GoogleShare this topic on Yahoo

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Linux Software Packages are Installed  (Read 101 times)

Offline thiruvasagamani

  • Moderator
  • Hero Member
  • *****
  • Posts: 6887
    • View Profile
Linux Software Packages are Installed
« on: September 27, 2008, 11:24:08 AM »
Linux Software Packages are Installed

Querying Packages

RPM has a powerful query feature that allows you to find out what packages are installed on your system, the files associated with a package, or the package that owns a particular file. Use the -q flag to tell RPM to display the package name, version number, and release number of a package that's already installed, as in this example:
   
rpm -q panda
panda-2.0-1


Here are some other flags you can use to specify the packages you want to query:

Flag Meanings

-a Queries all currently installed packages

-f somefile Queries the package that owns the specified file

-p packagefile Queries the specified package

And here are the flags you can use to control and format the information that your query returns:

Flag Meanings[/color]

-i Displays detailed package information such as name, description, release, size, build date, install date, and vendor

-l Displays all files associated with the package

-d Displays documentation and help files associated with the package

-c Displays configuration files associated with the package

-v Outputs file listings in the format of the ls -l command

Some Query Examples

You can combine the flags for the querying in may useful ways. Here are some examples.

To find out which package owns a file, enter

rpm -qf /usr/bin/panda
panda-2.0-1


To find the documentation that came with a package, enter

rpm -qd hotrod
/usr/man/man1/hotrod.1
/usr/info/hotrod.info.gz
/usr/doc/hotrod-1.0-1/README


To learn about a package before installing it, enter

rpm -qip hotrod-1.0-1.i386.rpm
Name : hotrod Distribution: Red Hat Linux
Version : 1.0 Vendor: Faster Software
Release : 1 Build Date: Sun Jul 04 14:35:27 1999
Install date: (none) Build Host: dev.faster.com
Group : Games Source RPM: hotrod-1.0-1.src.rpm
Size : 3141593
Summary : simulated hotrod racing game for SVGA
Description :
An action game that pits you against other maniacal drivers
on the Los Angeles freeway. Experience the thrill of road
rage as you attempt to get to work on time.

To see what files a package contains, enter

rpm -qlp hotrod-1.0-1.i386.rpm
/usr/man/man1/hotrod.1
/usr/info/hotrod.info.gz
/usr/doc/hotrod-1.0-1/README
/usr/lib/games/hotrodlib/cars.dat
/usr/lib/games/hotrodlib/drivers.dat
/usr/lib/games/hotrodlib/weapons.dat
/usr/lib/games/hotrodlib
/usr/games/hotrod


To find all installed packages that match a specific pattern, enter

rpm -qa | grep panda
panda-2.0-1
pandacalc-3.1-4
xpanda-1.2-3


Since the -q flag does accept a package name, you might wonder why we didn't use a command like this:

rpm -q panda*

This won't work because of the way the Bash shell treats wildcard characters, so we have to tell RPM to spit out all the installed package names and use grep to filter the list.

Finally, here's an advanced form of the query command that will tell you which packages are taking up the most room:

rpm -qa -queryformat='%{SIZE} %{NAME}' | sort -n

This command uses the -queryformat flag to specify that only the size and name information are to be printed for each package. The rpm output is piped to the sort command, which displays the package list sorted by size, from smallest to largest.
Thiruvasakamani Karnan


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
271 Views
Last post May 03, 2008, 11:07:25 AM
by hari
0 Replies
179 Views
Last post September 27, 2008, 03:04:07 PM
by thiruvasagamani
0 Replies
158 Views
Last post September 29, 2008, 06:33:26 PM
by thiruvasagamani
0 Replies
103 Views
Last post September 29, 2008, 06:35:13 PM
by thiruvasagamani
0 Replies
105 Views
Last post May 19, 2010, 04:34:02 PM
by Pradyumna