PKG_ADMIN(1)            NetBSD General Commands Manual            PKG_ADMIN(1)

NNAAMMEE
     ppkkgg__aaddmmiinn -- perform various administrative tasks to the pkg system

SSYYNNOOPPSSIISS
     ppkkgg__aaddmmiinn [--bbqqSSVVvv] [--CC _c_o_n_f_i_g] [--dd _l_s_d_i_r] [--KK _p_k_g___d_b_d_i_r] [--ss _s_f_x___p_a_t_t_e_r_n]
               _c_o_m_m_a_n_d [args ...]

DDEESSCCRRIIPPTTIIOONN
     This command performs various administrative tasks around the NetBSD
     Packages System.

OOPPTTIIOONNSS
     The following command-line options are supported:

     --bb      Print only the base names when matching package names for llssaallll
             and llssbbeesstt.

     --CC _c_o_n_f_i_g
             Read the configuration file from _c_o_n_f_i_g instead of the system
             default.

     --dd _l_s_d_i_r
             Set _l_s_d_i_r as the path to the directory in which to find matching
             package names for llssaallll and llssbbeesstt.

     --KK _p_k_g___d_b_d_i_r
             Override the value of the PKG_DBDIR configuration option with the
             value _p_k_g___d_b_d_i_r.

     --qq      Perform checks in a quiet manner.  In normal operation, ppkkgg__aaddmmiinn
             prints a `.' to standard output to indicate progress.  This
             option suppresses this progress indicator.

     --SS      Set the shell glob pattern for package suffixes when matching
             package names for llssaallll and llssbbeesstt to be the null suffix.

     --ss _s_f_x___p_a_t_t_e_r_n
             Set the shell glob pattern for package suffixes when matching
             package names for llssaallll and llssbbeesstt.  The default pattern is
             ".t[bg]z".

     --VV      Print version number and exit.

     --vv      Be more verbose.

     The following commands are supported:

     aadddd _p_k_g _._._.
             For each listed package, write the absolute pathnames of the
             files listed in its _+_C_O_N_T_E_N_T_S file together with the package they
             belong to into the package database.  This should be used only by
             pkg_view(1).

     aauuddiitt [--eess] [--tt _t_y_p_e] [_p_k_g] ...
             Check the listed installed packages for vulnerabilities.  If no
             package is given, check all installed packages.  If --ee is given,
             override the CHECK_END_OF_LIFE option from pkg_install.conf(5)
             with "yes".  If --ss is given, check the signature of the pkg-vul-
             nerabilities file before using it.  --tt restricts the reported
             vulnerabilities to type _t_y_p_e.

     aauuddiitt--ppkkgg [--eess] [--tt _t_y_p_e] [_p_k_g] ...
             Like aauuddiitt, but check only the given package names or patterns.

     aauuddiitt--bbaattcchh [--eess] [--tt _t_y_p_e] [_p_k_g_-_l_i_s_t] ...
             Like aauuddiitt--ppkkgg, but read the package names or patterns one per
             line from the given files.

     aauuddiitt--hhiissttoorryy [--ss] [--tt _t_y_p_e] [_p_k_g_b_a_s_e] ...
             Print all vulnerabilities for the given base package names.

     cchheecckk [_p_k_g _._._.]
             Use this command to check the files belonging to some or all of
             the packages installed on the local machine against the checksum
             which was recorded in the _+_C_O_N_T_E_N_T_S files at package installation
             time.  Symbolic links also have their integrity checked against
             the recorded value at package installation time.  If no addi-
             tional argument is given, the files of all installed packages are
             checked, else only the named packages will be checked (wildcards
             can be used here, see pkg_info(1)).

             The packages' _+_C_O_N_T_E_N_T_S files will be parsed and the checksum
             will be checked for every file found.  A warning message is
             printed if the expected checksum differs from the checksum of the
             file on disk.  Symbolic links are also checked, ensuring that the
             targets on disk are the same as the contents recorded at package
             installation time.

     cchheecckk--lliicceennssee _c_o_n_d_i_t_i_o_n
             Check if _c_o_n_d_i_t_i_o_n can be fulfilled with the currently set of
             accepted licenses.  Prints either yes or no to stdout if the con-
             dition can be parsed, otherwise it exits with error.

     cchheecckk--ppkkgg--vvuullnneerraabbiilliittiieess [--ss] _f_i_l_e
             Check format and hashes in the pkg-vulnerabilities file _f_i_l_e.  If
             --ss is given, also check the embedded signature.

     cchheecckk--ssiiggnnaattuurree _f_i_l_e _._._.
             Reports if _f_i_l_e is a correctly signed package.

     cchheecckk--ssiinnggllee--lliicceennssee _l_i_c_e_n_s_e
             Check if _l_i_c_e_n_s_e is a valid license name and if it is in the set
             of acceptable licenses.  Prints either yes or no to stdout if the
             condition can be parsed, otherwise it exits with error.

     ccoonnffiigg--vvaarr _v_a_r_i_a_b_l_e
             Print the current value of _v_a_r_i_a_b_l_e as used after parsing the
             configuration file.

     ddeelleettee _p_k_g _._._.
             For each listed package, remove all file entries in the package
             database that belong to the package.  This should be used only by
             pkg_view(1).

     dduummpp    Dump the contents of the package database, similar to ppkkgg__iinnffoo
             --FF.  Columns are printed for the key field used in the pkgdb -
             the filename -, and the data field - the package the file belongs
             to.

     ffeettcchh--ppkkgg--vvuullnneerraabbiilliittiieess [--ssuu]
             Fetch a new pkg-vulnerabilities file, check the format and if --ss
             is given the signature.  If all checks are passed, write it to
             pkgdb.  If --uu is given, the fetch is conditional and the file
             transfer is only done if the remote version is newer than the one
             in pkgdb.

     ffiinnddbbeesstt _p_a_t_t_e_r_n _._._.
             Search the entries of PKG_PATH for packages matching _p_a_t_t_e_r_n.
             Print the URL of the best matching package to stdout for each
             pattern.  If a pattern is not matched, it is skipped and the com-
             mand will return a failure.

     llssaallll _/_d_i_r_/_p_k_g_p_a_t_t_e_r_n

     llssbbeesstt _/_d_i_r_/_p_k_g_p_a_t_t_e_r_n
             List all/best package matching pattern in the given directory
             _/_d_i_r.  If the --dd flag is given, then that directory path over-
             rides _/_d_i_r.  Can be used to work around limitations of /bin/sh
             and other filename globbing mechanisms.  This option implements
             matching of pkg-wildcards against arbitrary files and directo-
             ries, useful mainly in the build system itself.  See pkg_info(1)
             for a description of the pattern.

             Example:

             yui# cd /usr/pkgsrc/packages/i386ELF/All/
             yui# ls unzip*
             unzip-5.40.tgz  unzip-5.41.tgz
             yui# pkg_admin lsall 'unzip*'
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
             yui# pkg_admin lsall 'unzip>=5.40'
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
             yui# pkg_admin lsall 'unzip>=5.41'
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
             yui# pkg_admin lsbest 'unzip>=5.40'
             /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
             yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*'
             /usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz
             /usr/pkgsrc/packages/i386ELF/All/unproven-pthreads-0.15.tgz

     ppmmaattcchh _p_a_t_t_e_r_n _p_k_g
             Returns true if _p_k_g matches _p_a_t_t_e_r_n, otherwise returns false.

     rreebbuuiilldd
             Rebuild the package database mapping from scratch.  This option
             is only intended for recovery after system crashes during package
             installation and removal.

     rreebbuuiilldd--ttrreeee
             Rebuild the +REQUIRED_BY files from scratch by reresolving all
             dependencies.

             This option is intended to be used for fixing inconsistencies
             between the records of depending and depended-on packages, such
             as can arise by the use of ppkkgg__ddeelleettee --ff.

     sseett _v_a_r_i_a_b_l_e_=_v_a_l_u_e _p_k_g _._._.
             Set variable with information about the installed package.  Use
             uunnsseett to remove a variable.

             Packages that are not installed directly by the user but pulled
             in as dependencies are marked by setting ``automatic=YES''.

     ggppgg--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg
             Sign the binary package _p_k_g using GPG and write the result to
             _s_p_k_g.

     xx550099--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg kkeeyy cceerrtt
             Sign the binary package _p_k_g using the key _k_e_y and the certificate
             _c_e_r_t, using _s_p_k_g as output file.

     uunnsseett _v_a_r_i_a_b_l_e _p_k_g _._._.
             Remove an installation variable.

EENNVVIIRROONNMMEENNTT
     See pkg_install.conf(5) for options, that can also be specified using the
     environment.

FFIILLEESS
     /var/db/pkg/pkgdb.byfile.db
     /var/db/pkg/<pkg>/+CONTENTS

SSEEEE AALLSSOO
     pkg_add(1), pkg_create(1), pkg_delete(1), pkg_info(1), pkg_view(1),
     pkg_install.conf(5), pkgsrc(7)

HHIISSTTOORRYY
     The ppkkgg__aaddmmiinn command first appeared in NetBSD 1.4.

AAUUTTHHOORRSS
     The ppkkgg__aaddmmiinn command was written by Hubert Feyrer.

NetBSD 5.0                     January 22, 2010                     NetBSD 5.0
