pkg
Manage software packages
SYNOPSIS
pkg command [options] [arguments]
PARAMETERS
add
Adds a package to the system.
annotate
Annotate packages or repositories.
audit
Audits installed packages for security vulnerabilities.
autoremove
Removes automatically installed packages that are no longer required.
backup
Backup packages to a remote host.
bootstrap
Installs the `pkg` utility itself.
check
Checks package integrity, dependencies, and metadata.
clean
Cleans the local package cache.
config
Modifies pkg configuration.
convert
Converts a package from a legacy format.
create
Creates a new package.
delete
Deletes a package from the system.
fetch
Fetches packages from remote repositories without installing them.
info
Displays information about a package.
install
Installs a package.
lock
Locks a package to prevent upgrades.
plugins
Manage pkg plugins.
query
Queries the package database.
rquery
Queries remote package repositories.
register
Registers a package in the database.
remove
Removes a package.
repo
Manage repositories.
search
Searches for packages in remote repositories.
set
Set package metadata.
shell
Starts an interactive pkg shell.
shlib
Manage shared library dependencies.
ssh
SSH related functionalities.
stats
Displays package statistics.
unlock
Unlocks a package, allowing upgrades.
update
Updates the local package database from remote repositories.
upgrade
Upgrades installed packages to the latest versions.
version
Display version information.
DESCRIPTION
The `pkg` command is a powerful package management utility used primarily in FreeBSD and DragonFlyBSD operating systems. It facilitates the installation, removal, upgrading, and querying of software packages from repositories. Think of it as apt-get or yum for the BSD world. `pkg` uses pre-built binary packages, greatly simplifying software installation compared to compiling from source (ports). It maintains a database of installed packages and their dependencies, ensuring consistency and preventing conflicts. Key functionalities include searching for packages, installing/uninstalling them, upgrading the entire system, and managing package repositories.
It simplifies system administration by automating dependency resolution and provides a consistent interface for managing software throughout the system lifecycle.
CAVEATS
Package management can sometimes be complex, especially with dependency resolution. Always review the changes `pkg` proposes before confirming them, particularly during upgrades.
CONFIGURATION FILES
The primary configuration file for `pkg` is located at /usr/local/etc/pkg.conf. This file controls various aspects of `pkg`'s behavior, such as repository locations, caching settings, and network configurations.
REPOSITORIES
`pkg` relies on remote repositories to obtain package information and binary files. These repositories are typically configured in the `pkg.conf` file or in individual repository configuration files within the /usr/local/etc/pkg/repos directory.
HISTORY
The `pkg` command was developed as a replacement for the older, more rudimentary package management tools available in FreeBSD. Its initial development focused on creating a robust and efficient system that could handle complex dependency graphs and offer a more user-friendly interface. It gained widespread adoption due to its speed, reliability, and modern features, eventually becoming the default package manager for FreeBSD. Continuous development ensures ongoing improvements, security updates, and feature enhancements.