|
NAMEpkg —
a utility for manipulating packages
SYNOPSIS
DESCRIPTIONpkg is the package management tool. It is used to manage
local packages installed from
ports(7)
and install/upgrade packages from remote repositories.
To avoid backwards incompatibility issues, the actual
pkg(8)
tool is not installed in the base system. The first time invoked,
CONFIGURATIONConfiguration varies in whether it is in a repository configuration file or the global configuration file. The default repository configuration for FreeBSD is stored in /etc/pkg/FreeBSD.conf, and additional repository configuration files will be searched for inREPOS_DIR ,
or /usr/local/etc/pkg/repos if it is unset.
For bootstrapping, 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 }
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. ENVIRONMENTThe following environment variables can be set to override the settings from the pkg.conf file used.
FILESConfiguration is read from the files in the listed order. This path can be changed by setting REPOS_DIR. The last enabled repository is the one used for bootstrapping pkg(8).
EXAMPLESSome examples are listed here. The full list of available commands are available in pkg(8) once it is bootstrapped.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 set -A 0 perl Change a package from non-automatic to automatic, which will make
% 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 SEE ALSOports(7), pkg(8)HISTORYThepkg command first appeared in
FreeBSD 9.1. It became the default package tool in
FreeBSD 10.0, replacing the pkg_install suite of tools
pkg_add(1),
pkg_info(1)
and
pkg_create(1).
Visit the GSP FreeBSD Man Page Interface. |