PKG_ADMIN(1) NetBSD General Commands Manual PKG_ADMIN(1) NNAAMMEE ppkkgg__aaddmmiinn - perform various administrative tasks to the pkg system SSYYNNOOPPSSIISS ppkkgg__aaddmmiinn [--VV] [--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 basenames when matching package names for llssaallll and llssbbeesstt. --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 Set _p_k_g___d_b_d_i_r as the package database directory. If this option isn't specified, then the package database directory is taken from the value of the environment variable PKG_DBDIR if it's set, otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. --SS Set the shell glob pattern for package suffices when matching package names for llssaallll and llssbbeesstt to be the null suffix. The default pattern is ".t[bg]z". --ss _s_f_x___p_a_t_t_e_r_n Set the shell glob pattern for package suffices when matching package names for llssaallll and llssbbeesstt. The default pattern is ".t[bg]z". --VV Print version number and exit. The following commands are supported: aadddd _p_k_g _._._. For each listed package, write the absolute pathnames of the files listed in its +CONTENTS file together with the package they belong to into the package database. This should be used only by pkg_view(1). 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 their MD5 checksum noted in their +CONTENTS files. If no additional argu- ment 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' +CONTENTS files will be parsed and the MD5 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. 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 keyfield used in the pkgdb - the filename -, and the data field - the package the file belongs to. 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, scanning sub- directories in _/_v_a_r_/_d_b_/_p_k_g for _+_C_O_N_T_E_N_T_S files, parsing them and writing the resulting absolute pathnames together with the pack- age they belong to into the package database. This option is intended to be used for upgrading from non-pkgdb- pkg_* tools to pkgdb-pkg_* tools, further manipulation of the pkgdb will be done by pkg_add(1), pkg_delete(1), and pkg_create(1). Needs to be run as root. EENNVVIIRROONNMMEENNTT PKG_DBDIR If the --KK flag isn't given, then PKG_DBDIR is the location of the package database directory. The default package database direc- tory is _/_v_a_r_/_d_b_/_p_k_g. FFIILLEESS /var/db/pkg/pkgdb.byfile.db /var/db/pkg//+CONTENTS SSEEEE AALLSSOO pkg_add(1), pkg_create(1), pkg_delete(1), pkg_info(1), pkg_view(1), packages(7) HHIISSTTOORRYY The ppkkgg__aaddmmiinn command first appeared in NetBSD 1.4. AAUUTTHHOORRSS The ppkkgg__aaddmmiinn command was written by Hubert Feyrer. NetBSD 1.6 September 8, 2003 NetBSD 1.6