Main index | Section 7 | Options |
To avoid backwards incompatibility issues, the actual pkg(8) tool is not installed in the base system. The first time invoked, pkg will bootstrap the real pkg(8) from a remote repository.
Ar | If pkg(8) is not installed yet, it will be fetched, have its signature verified, installed, and then have the original command forwarded to it. If already installed, the command requested will be forwarded to the real pkg(8). |
Cm |
Install
pkg(8)
from a local package instead of fetching from remote.
If signature checking is enabled, then the correct signature file
must exist and the signature valid before the package will be installed.
If the
If a reponame has been specified, then the signature configuration for that repository will be used. |
Fl | Do not bootstrap, just determine if pkg(8) is actually installed or not. Returns 0 and the number of packages installed if it is, otherwise 1. |
Oo |
Oo Fl r Ar reponame Oc
Attempt to bootstrap and do not forward anything to
pkg(8)
after it is installed.
With
If a reponame has been specified, then the configuration for that repository will be used. |
For bootstrapping, pkg will process all repositories that it finds and use the last enabled repository by default.
Repository configuration is stored in the following format:
FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "none", fingerprints: "/usr/share/keys/pkg", enabled: yes }
url | Refer to PACKAGESITE in ENVIRONMENT |
mirror_type | Refer to MIRROR_TYPE in ENVIRONMENT |
signature_type | |
Refer to SIGNATURE_TYPE in ENVIRONMENT | |
fingerprints | Refer to FINGERPRINTS in ENVIRONMENT |
enabled | Defines whether this repository should be used or not. Valid values are yes, true, 1, no, false, 0. |
Global configuration can be stored in /usr/local/etc/pkg.conf in the following format:
PACKAGESITE: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", MIRROR_TYPE: "srv", SIGNATURE_TYPE: "none", FINGERPRINTS: "/usr/share/keys/pkg", ASSUME_ALWAYS_YES: "yes" REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]
Reference ENVIRONMENT for each variable.
MIRROR_TYPE | This defines which mirror type should be used. Valid values are SRV, HTTP, NONE. |
ABI | This defines the ABI for the package to be installed. Default ABI is determined from /bin/sh. |
ASSUME_ALWAYS_YES | |
If set, no confirmation will be asked when bootstrapping pkg(8). | |
SIGNATURE_TYPE | If set to FINGERPRINTS then a signature will be required and validated against known certificate fingerprints when bootstrapping pkg(8). |
FINGERPRINTS | If SIGNATURE_TYPE is set to FINGERPRINTS this value should be set to the directory path where known fingerprints are located. |
PACKAGESITE | The URL that pkg(8) and other packages will be fetched from. |
REPOS_DIR | Comma-separated list of directories that should be searched for repository configuration files. |
/usr/local/etc/pkg.conf
/etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/*.conf | |
Search for a package:
$ pkg search perl
Install a package:
% pkg install perl
List installed packages:
$ pkg info
Upgrade from remote repository:
% pkg upgrade
List non-automatic packages:
$ pkg query -e '%a = 0' %o
List automatic packages:
$ pkg query -e '%a = 1' %o
Delete an installed package:
% pkg delete perl
Remove unneeded dependencies:
% pkg autoremove
Change a package from automatic to non-automatic, which will prevent pkg-autoremove(8) from removing it:
% pkg set -A 0 perl
Change a package from non-automatic to automatic, which will make pkg-autoremove(8) allow it be removed once nothing depends on it:
% pkg set -A 1 perl
Create package file from an installed package:
% pkg create -o /usr/ports/packages/All perl
Determine which package installed a file:
$ pkg which /usr/local/bin/perl
Audit installed packages for security advisories:
$ pkg audit
Check installed packages for checksum mismatches:
# pkg check -s -a
Check for missing dependencies:
# pkg check -d -a
PKG (7) | June 30, 2022 |
Main index | Section 7 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.