GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PKGDB(1) FreeBSD General Commands Manual PKGDB(1)

pkgdb, pkg_which
tools to manage and search the package database

pkgdb [-ahfFiLOQQquv] [-o pkgname] [-s /old/new/]

pkg_which [-hQQq] [-c pkgname] [file] ...

The pkgdb command is a tool to create or update the system package database which is used by the portupgrade(1) tool suite. It maintains a hash that maps an installed file to a package name, a hash that maps a package to an origin, and a list of installed packages.

pkg_which looks in the package database to tell which package each specified file came from. If the database is outdated but you do not have permission to update it, it delegates tasks to pkg_info(1).

Actually, pkgdb and pkg_which are the same command, and are equivalent.

The pkgdb command also works as an interactive tool for fixing the package registry database when -F is specified. It helps you resolve stale dependencies, unlink cyclic dependencies, complete stale or missing origins and remove duplicates. You should run this command periodically so portupgrade(1) and other pkg_* tools can work effectively and reliably.

The following command line arguments are supported:

file
Inquire which package file came from. If the file is not present, pkg_which calls which(1) to search PATH for the file.

 
Show help and exit.

 
Turn on automatic mode when -F is also specified. pkgdb only fixes discrepancies that can be fixed securely and leaves the others.

Shorthand of --auto --fix (-aF).

PKGNAME
 
PKGNAME
Show files installed by the given package that have been overwritten by other packages.

 
Force; Specified with -u, update database regardless of timestamps. Specified with -F, fix "held" packages too.

 
Interactively fix the package registry database.

 
Turn on interactive mode.

 
Check and restore lost dependencies against the ports tree.

PKGNAME
 
PKGNAME
Look up the origin of the given package in the package database.

 
Specified with -F, turn off check dependencies against the ports tree. Useful if you need a speed-up.

 
Do not write anything to stdout. Specified twice, do not write anything to stderr either. This is for internal use.

 
Do not read the configuration file - $PREFIX/etc/pkgtools.conf.

/OLD/NEW/
 
/OLD/NEW/
Substitute all the dependencies recorded as OLD with NEW and exit.

 
Update or create the package database file pkgdb.db in $PKG_DBDIR, which is /var/db/pkg by default.

Note: if the ports database files are stale, pkgdb will automatically update them before proceeding, so manual updating is not mandatory.

 
Turn on verbose output.

Alternative location for the installed package database. Default is “/var/db/pkg”.

Alternative location for the ports tree. Default is “/usr/ports”.

Alternative location for the ports INDEX file. Default is “$PORTSDIR/INDEX”.

Alternative location for the ports database files. Default is “$PORTSDIR”. The database files in the directory are automatically created or updated as necessary. See portsdb(1) for details.

Configuration file for the pkgtools suite. Default is “$PREFIX/etc/pkgtools.conf”.

/var/db/pkg
Default location of the package database.

$PREFIX/etc/pkgtools.conf
Default location of the pkgtools configuration file.

  • Get a list of files under /usr/local and /usr/X11R6 that do not belong to any package:

    find /usr/local /usr/X11R6 -type f -print0 | xargs -0 pkg_which -v | fgrep '?'

portsclean(1), portsdb(1), portupgrade(1), pkgtools.conf(5), ports(7)

The idea of pkgdb.db was taken from NetBSD.

Akinori MUSHA ⟨knu@iDaemons.org⟩
Sergey Matveychuk ⟨sem@FreeBSD.org⟩

Sometimes a database may get corrupt, and the pkgtools commands may abort with a segmentation fault. In such cases, run “pkgdb -fu” to rebuild the database, and the problems should go away.
February 23, 2007 FreeBSD

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.