from small one page howto to huge articles all in one place

search text in:

Other sites:

Last additions:
How to make X listen on port 6000

How to make X listen on port 6000






average rating: 1.5 (4 votes) (1=very good 6=terrible)

May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tips&Tricks

Using qpkg

This tip demonstrates some basic uses of the "query package" (qpkg) which allows you to perform get information about installed or uninstalled packages on your system. It can be used to find package ownership of files, to find duplicate packages, to list the files installed by a package, and more.

To get qpkg you need to install app-portage/gentoolkit.

Code Listing 1: Installing gentoolkit

# emerge app-portage/gentoolkit

Now that you have qpkg installed, you can start using it to examine your system. The first example is figuring out which package owns which file. This is done with the --find-file (or alternatively --find-pattern option.

Note: To get a complete list of packages and the version installed on your machine use the command qpkg --installed --verbose.

Code Listing 2: Finding the package that owns a file

// Which package owns /etc/crontab? 
% qpkg --find-file /etc/crontab 
sys-apps/vcron * 
// What version of vcron? (--verbose) 
% qpkg --find-file --verbose /etc/crontab 
sys-apps/vcron-3.0.1-r1 * 
// Where's the ebuild for this file? (--verbose --verbose) 
% qpkg --find-file --verbose --verbose /etc/crontab 
sys-apps/vcron-3.0.1-r1 *

To list all the files a package installed, use the --list option.

Code Listing 3: Listing all the files installed by a package

% qpkg --list units 
// Directories were snipped for brevity 
app-sci/units-1.74 * 

The last example shows you how to find which packages depend on a specified package using --query-deps.

Code Listing 4: Finding dependencies

% qpkg --installed --query-deps mozilla 
net-www/mozilla-1.4-r3 * 

Note: Not specifying --installed causes qpkg to look inside the entire Portage tree which is probably not what you want.

This should get you started with qpkg. For more options see qpkg --help or man 1 qpkg.


rate this article:
current rating: average rating: 1.0 (206 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)


Other free services
Shorten long
URLs to short
links like
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 65.5 ms