PKGIN(1) BSD General Commands Manual PKGIN(1)NAMEpkgin — A tool to manage pkgsrc binary packages.
SYNOPSISpkgin [-dfFhPvVyn] [-l limit_chars] [-c chroot_path] [-t log_file]
command [package ...]
The pkgin command is aimed at being an apt / yum like tool for managing
pkgsrc binary packages. It relies on pkg_summary(5) for installation,
removal and upgrade of packages and associated dependencies, using a
The following command line arguments are supported:
-d Download only.
-f Force database update.
-F Force package reinstall.
-h Displays help for the command.
-P Displays packages versions instead of globs (sd, sfd, srd)
-v Displays pkgin version
-V Be verbose when (un)installing
-y Assumes "yes" as default answer, except for autoremove.
-n Assumes "no" as default answer.
Only include the packages with the specified status flags.
Enable chrooting pkgin in the given repository
Logs package browsing (dependencies and impact) to a given log
The pkgin utility provides several commands:
autoremove Automatically removes orphan dependencies.
avail Lists all packages available in the repository.
clean Delete downloaded packages from the cache directory.
export Export the list of non-autoremovable packages to stdout (one
category/package by line)
Upgrade all packages to their newer versions present in the
Import a list of packages to be installed from file (one cat‐
egory/package by line)
install package ...
Performs installation or upgrade of package. If more than
one packages are specified on the command-line, all will be
installed (or upgraded).
keep package ...
Marks package as "non auto-removable". This means that a
package that has, for instance, been compiled manually from
pkgsrc, can't be removed through a pkgin upgrade. More than
one package can be specified on the command-line, to mark
several packages as non-removable in a single command.
list Lists all packages installed locally on a system. If the l
modifier is added to this command, show only packages match‐
ing the status flag.
Show remote package content.
Show remote package long-description.
Show remote package build definitions.
Shows what a package provides to others
remove package ...
Removes package as well as all packages depending on it.
When more than one package are specified, they will all be
uninstalled. By default, it will prompt you to confirm
before package removals.
Shows what a package requires from others packages.
Performs a regular expression search for a pattern in the
show-deps Displays all direct dependencies
Displays all direct dependencies recursively
Displays all reverse direct dependencies for package. If
more than one package is specified, pkgin will show recur‐
sively reverse direct dependencies for all packages on the
Show packages belonging to category.
Show package category.
show-keep Display "non auto-removable" packages.
Display "auto-removable" packages.
unkeep package ...
Marks package as "auto-removable". If no other package
depends on it, it will be removed when using the autoremove
update Creates and populates the initial database of locally
installed packages and available packages (from the remote
pkg_summary(5) list). This is done automatically when pkgin
is first used, when the system package database has been mod‐
ified. or when pkgin is upgraded to a new database version.
upgrade Upgrade keepable packages to their newer versions present in
the repository. If the installed dependencies match the
listed needed dependencies, don't upgrade them.
When using the l flag along with the list command, the following status
flag must be set:
= The installed version of the package is current.
< The installed version of the package is older than the current
> The installed version of the package is newer than the current
The PKG_REPOS environment variable can be pointed to a suitable
repository or a list of space separated repositories in order to
This file contains a list of repository URIs that pkgin will use.
It may contain macros $arch to define the machine hardware plat‐
form and $osrelease to define the release version for the operat‐
ing system (as reported by uname(3)).
Setup the initial database:
# echo ftp://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All > /opt/local/etc/pkgin/repositories.conf
# pkgin update
processing local summary...
updating database: 100%
downloading pkg_summary.bz2: 100%
processing remote summary (ftp://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All)...
updating database: 100%
Listing all packages available in the repository:
# pkgin avail | more
autoconf-2.63 Generates automatic source code configuration scripts
aumix-gtk-2.8nb3 Set mix levels (ncurses and GTK+ 2.0 interfaces)
aumix-2.8nb7 Set mix levels (ncurses interface only)
august-0.63b Simple Tk-based HTML editor
audacity-1.2.6nb3 Audio editor
Install packages and their dependencies:
# pkgin install links eterm
nothing to upgrade.
11 packages to be installed: tiff-3.8.2nb4 png-1.2.35 libungif-4.1.4nb1 libltdl-1.5.26 jpeg-6bnb4 pcre-7.8 perl-5.10.0nb5 libast-0.6.1nb3 imlib2-1.4.2nb1 links-2.2nb1 eterm-0.9.4nb1 (25M to download, 64M to install)
proceed ? [y/N]
Remove packages and their reverse dependencies:
# pkgin remove links eterm
2 packages to delete: links-2.2nb1 eterm-0.9.4nb1
proceed ? [y/N]
Remove orphan dependencies:
# pkgin autoremove
in order to remove packages from the autoremove list, flag those with the -k modifier.
9 packages to be autoremoved: libast-0.6.1nb3 pcre-7.8 imlib2-1.4.2nb1 tiff-3.8.2nb4 png-1.2.35 libungif-4.1.4nb1 libltdl-1.5.26 perl-5.10.0nb5 jpeg-6bnb4
proceed ? [y/N]
SEE ALSOpkg_add(1), pkg_info(1), pkg_summary(5), pkgsrc(7)AUTHORS
Emile “iMil” Heitor
Initial work and ongoing development.
Jeremy C. Reed
Testing and refinements.
Tests and patches
SQLite schema, and SQL queries debugging.
Antonio Huete Jimenez
Min Sik Kim
FreeBSD port and patches
We're hunting them.
BSD Dec 6, 2009 BSD