1.\" $OpenBSD: pkg_info.1,v 1.60 2019/07/04 15:25:16 tb Exp $ 2.\" 3.\" Documentation and design originally from FreeBSD. All the code has 4.\" been rewritten since. We keep the documentation's notice: 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" Jordan K. Hubbard 16.\" 17.\" 18.Dd $Mdocdate: July 4 2019 $ 19.Dt PKG_INFO 1 20.Os 21.Sh NAME 22.Nm pkg_info 23.Nd display information on software packages 24.Sh SYNOPSIS 25.Nm pkg_info 26.Bk -words 27.Op Fl AaCcdfIKLMmPqRSstUvz 28.Op Fl D Ar name Ns Op = Ns Ar value 29.Op Fl E Ar filename 30.Op Fl e Ar pkg-name 31.Op Fl l Ar str 32.Op Fl Q Ar query 33.Op Fl r Ar pkgspec 34.Op Ar pkg-name ... 35.Ek 36.Sh DESCRIPTION 37The 38.Nm 39command is used to dump out information for packages, as created by 40.Xr pkg_create 1 , 41which may be still 42packed up or already installed on the system with the 43.Xr pkg_add 1 44command. 45.Pp 46The 47.Ar pkg-name 48may be the name of an installed package, the pathname to a package 49distribution file, or a URL to a package available through FTP, HTTP, HTTPS, 50or SCP. 51.Nm 52will try to complete 53.Ar pkg-name 54with a version number while looking through installed packages. 55.Pp 56When browsing through uninstalled packages, running 57.Ic pkg_info -I *.tgz 58will report a summary line for each package, so that it is possible to 59run 60.Ic pkg_info pkgname.tgz 61to obtain a longer package description, and 62.Ic pkg_add -n pkgname.tgz 63to check that the installation would proceed cleanly, including dependencies. 64.Pp 65The following command-line options are supported: 66.Bl -tag -width indent 67.It Fl A 68Show information for all currently installed packages, 69including internal packages. 70.It Fl a 71Show information for all currently installed packages. 72.It Fl C 73Show certificate information for signed packages. 74.It Fl c 75Show the one-line comment field for each package. 76.It Fl D Ar name Ns Op = Ns Ar value 77Enforce extra options as given by 78.Ar name , 79similarly to 80.Xr pkg_add 1 . 81.Pp 82.Bl -tag -width "updatedependsXX" -compact 83.It Cm SIGNER 84List of trusted signers, separated by commas. 85Corresponds to list of public keys under 86.Pa /etc/signify 87we want to trust. 88Defaults to any key matching 89.Sq *pkg 90for packages, and any key matching 91.Sq *fw 92for firmware. 93.It Cm snap 94Force 95.Sq %c 96and 97.Sq %m 98to expand to 99.Sq snapshots , 100even on a release kernel. 101.It Cm unsigned 102Allow opening unsigned packages without warnings/errors 103(necessary for 104.Xr ports 7 , 105automatically set by the build infrastructure). 106.El 107.It Fl d 108Show the long-description field for each package. 109.It Fl E Ar filename 110Look for the package(s) that contains the given 111.Ar filename . 112As a faster alternative, note that there is a package, pkglocatedb, that 113contains a 114.Xr locate 1 115database of every file in every package. 116.It Fl e Ar pkg-name 117This option 118allows you to test for the presence of another (perhaps 119prerequisite) package from a script. 120If the package identified by 121.Ar pkg-name 122is currently installed, return 0, otherwise return 1. 123In addition, the names of any package(s) found installed are printed to 124stdout unless turned off using the 125.Fl q 126option. 127.Pp 128The given 129.Ar pkg-name 130is actually a package specification, as described in 131.Xr packages-specs 7 . 132For example, 133.Ic pkg_info -e 'name->=1.3' 134will match versions 1.3 and later of the 135.Pa name 136package. 137.It Fl e Ar pkgpath 138Another variant of this option that uses a pkgpath instead. 139A pkgpath is a location within the ports tree, as described 140in 141.Xr pkgpath 7 . 142For example, 143.Ic pkg_info -e x11/kde/base3 144will match any package that was compiled according to 145.Pa ${PORTSDIR}/x11/kde/base3 . 146.It Fl f 147Show the packing-list instructions for each package. 148See 149.Xr pkg_create 1 150and 151.Xr package 5 152for the various annotations. 153.It Fl I 154Show the index entry for each package. 155.It Fl K 156Prefix file names with category keyword (e.g., @file, @lib). 157Always used together with 158.Fl L . 159.It Fl L 160Show the files within each package. 161This is different from just 162viewing the packing-list, since full pathnames for everything 163are generated. 164.It Fl l Ar str 165Prefix each information category header (see 166.Fl q ) 167shown with 168.Ar str . 169This is primarily of use to front-end programs that want to request a 170lot of different information fields at once for a package, but don't 171necessarily want the output intermingled in such a way that they can't 172organize it. 173This lets you add a special token to the start of each field. 174.It Fl M 175Show the install-message file (if any) for each package. 176.It Fl m 177Only show packages tagged as manual installations. 178It should omit anything 179installed automatically as a dependency. 180.It Fl P 181Show the 182.Xr pkgpath 7 183for each package. 184You can easily build a subdirlist with this. 185.It Fl Q Ar query 186Show all packages in $PKG_PATH which match the given 187.Ar query . 188.It Fl q 189Be 190.Dq quiet 191in emitting report headers and such, just dump the 192raw info (basically, assume a non-human reading). 193.It Fl R 194Show which packages require a given package. 195.It Fl r Ar pkgspec 196Check a list for a given 197.Ar pkgspec . 198The following arguments are names of packages to verify. 199Exit status will be augmented by 2 if none of the packages do match. 200.It Fl S 201Show the update signature for each package. 202The 203.Sq update signature 204is a unique tag showing the package name, a global version number, 205and the version number 206of every run time dependency and shared library used to build this package. 207.It Fl s 208Show an estimate of the total size of each package. 209.It Fl t 210Show packages which are not required by any other packages. 211.It Fl U 212Show the deinstall-message file (if any) for each package. 213.It Fl v 214Turn on verbose output. 215.It Fl z 216Fuzzy listing option, often used together with 217.Fl m . 218Only shows stems, flavors and branches information. 219To be reused with 220.Xr pkg_add 1 221.Fl l 222to recreate a package installation with different versions and no ambiguity. 223Note that this intentionally does not include firmware, as they are not 224handled by 225.Xr pkg_add 1 . 226.El 227.Sh ENVIRONMENT 228.Bl -tag -width PKG_TMPDIR 229.It Ev PKG_DBDIR 230The standard package database directory, 231.Pa /var/db/pkg , 232can be overridden by specifying an alternative directory in the 233.Ev PKG_DBDIR 234environment variable. 235.It Ev PKG_PATH 236This can be used to specify a colon-separated list of paths to search for 237package files. 238The current directory is always searched first, even if 239.Ev PKG_PATH 240is set. 241If 242.Ev PKG_PATH 243is used, the suffix 244.Dq .tgz 245is automatically appended to the 246.Ar pkg-name , 247whereas searching in the current directory uses 248.Ar pkg-name 249literally. 250Each entry consists of a directory name. 251URL schemes such as FTP, HTTP, HTTPS, or SCP are also appropriate. 252The current directory may be indicated 253implicitly by an empty directory name, or explicitly by a single 254period 255.Pq Ql \&./ . 256Special sequences 257.Sq %a , 258.Sq %c , 259.Sq %m , 260.Sq %v 261will be expanded. 262.It Ev PKG_TMPDIR 263Temporary area where package information files will be extracted, instead of 264.Pa /tmp . 265.It Ev TRUSTED_PKG_PATH 266Same semantics as 267.Ev PKG_PATH , 268but it is searched before 269.Ev PKG_PATH 270and waives any kind of signature checking. 271.El 272.Sh TECHNICAL DETAILS 273Package info is either extracted from package files named on the 274command line, or from already installed package information 275in 276.Pa /var/db/pkg/<pkg-name> . 277.Sh SEE ALSO 278.Xr pkg_add 1 , 279.Xr pkg_create 1 , 280.Xr pkg_delete 1 , 281.Xr bsd.port.mk 5 , 282.Xr package 5 , 283.Xr packages-specs 7 , 284.Xr pkgpath 7 285.Sh AUTHORS 286.Bl -tag -width indent -compact 287.It An Jordan Hubbard 288initial design 289.It An Marc Espie 290complete rewrite 291.El 292