PKGIN(1)

NAME
pkgin - pkgsrc binary package manager

SYNOPSIS
pkgin [-46dfhnPpVvy] [-c chroot_path] [-l limit_chars] [-t log_file] command [package file ...]

DESCRIPTION
pkgin is a package manager for binary package sets that have been produced by pkgsrc(7).

By parsing pkg_summary(5) files stored within each configured repository, it supports installing, upgrading, removing, and querying available packages.

OPTIONS
The following command line arguments are supported:

-4  Forces to only use IPv4 addresses.

-6  Forces to only use IPv6 addresses.

-c chroot_path
    Enable chrooting pkgin in the given repository

-d  Download only

-f  Force database update

-h  Displays help for the command

-l limit_chars
    Only include the packages with the specified STATUS FLAGS

-n  Assumes “no” as default answer and print results of actions to be taken line per line

-P  Displays packages versions instead of globs (sd, sfd, srd)

-p  Displays results in a parsable format

-t log_file
    Logs package browsing (dependencies and impact) to a given log file

-V  Be verbose when (un)installing

-v  Displays pkgin version

-y  Assumes “yes” as default answer, except for autoremove

The pkgin utility provides several commands:

autoremove
    Automatically removes orphan dependencies. When used with the -n flag, it can be used to show packages that are possibly not necessary.

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).

import file
    Import a list of packages to be installed from file (one category/package by line)

install package|glob file ...
    Performs installation or upgrade of package. If more than one packages are specified on the command-line, all will be installed (or upgraded). Instead of a package name, a glob can be specified in order to install specific versions.

    Example:
        pkgin install 'mysql-server>=5.6<5.7'

keep package file ...
    Marks package as "non auto-removable". A keep-able package is equivalent to a non-automatic package in pkgsrc(7) terminology.

list
    Lists all packages installed locally on a system. If the -l modifier is added to this command, show only packages matching the status flag.

pkg-build-defs package
    Show remote package build definitions.

pkg-content package
    Show remote package content.

pkg-descr package
    Show remote package long-description.

provides package
    Shows what a package provides to others.

remove package file ...
    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.

requires package
    Shows what a package requires from other packages.

search pattern
    Performs a regular expression search for the pattern pattern in the repository.

show-deps package
    Displays all direct dependencies.

show-full-deps package
    Displays all direct dependencies recursively.

show-rev-deps package
    Displays all reverse direct dependencies for package. If more than one package is specified, pkgin will show recursively reverse direct dependencies for all packages on the command-line.

show-category category
    Show packages belonging to category.

show-pkg-category package
    Show package category.

show-keep
    Display “non auto-removable” packages.

show-no-keep
    Display “auto-removable” packages.

unkeep package file ...
    Marks package as “auto-removable”. If no other package depends on it, it will be removed when using the autoremove modifier. It is equivalent to an automatic package in pkgsrc(7) terminology.

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 modified, or when pkgin is upgraded to a new database version.

upgrade
    Upgrade all packages to the newest versions available in the repository.

STATUS FLAGS
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 version.

>   The installed version of the package is newer than the current version.

ENVIRONMENT

PKG_REPOS
    The PKG_REPOS environment variable can be pointed to a suitable repository or a list of space separated repositories in order to override /opt/local/etc/pkgin/repositories.conf.

FILES

/opt/local/etc/pkgin/repositories.conf
    This file contains a list of repository URIs that pkgin will use. It may contain macros $arch to define the machine hardware platform and $osrelease to define the release version for the operating system (as reported by uname(1)).

/opt/local/etc/pkgin/preferred.conf
    This file contains a list of preferences regarding packages to be installed or upgraded. Each line defines a package preference taking the form of a simple glob(3), such as:

        autoconf=2.69.*
        mysql-server<5.6
        php>=5.4

/var/db/pkgin
    This directory contains the individual files and directories used by pkgin listed below.

/var/db/pkgin/cache
    This directory contains the packages downloaded by pkgin. It is safe to empty it if necessary by running:

        # pkgin clean

/var/db/pkgin/pkgin.db
    This is the main pkgin sqlite database. This format has been chosen in order to parse, query, match and order packages using the SQL language thus making packages list manipulation a lot easier.

/var/db/pkgin/pkg_install-err.log
    This file contains errors and warnings given by pkg_add(1) and pkg_delete(1), which are the tools called by pkgin to manipulate packages themselves.

/var/db/pkgin/sql.log
    This file contains SQL errors that might have occurred on a sqlite query. Mainly for debugging purposes.

EXAMPLES
Setup the initial database:

    # vi /opt/local/etc/pkgin/repositories.conf
    https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/9.0/All

    # pkgin update

Listing all packages available in the repository:

    # pkgin avail

Search for specific packages:

    # pkgin search '^abook|lbdb|mutt|xlhtml'
    abook-0.6.1 Text-based addressbook program
    lbdb-0.48.1nb1 The little brother's database
    mutt-1.14.5 = Text-based MIME mail client with PGP & S/MIME support
    xlhtml-0.5nb2 Microsoft xls/ppt to HTML converter

    # pkgin search '^php-'
    php-7.4.7 PHP Hypertext Preprocessor version 7.4
    php-7.3.19 PHP Hypertext Preprocessor version 7.3
    php-7.2.31nb1 PHP Hypertext Preprocessor version 7.2
    php-5.6.40nb3 PHP Hypertext Preprocessor version 5.6
    php-mode-1.13.1 PHP editing mode for Emacs

Install packages and their dependencies:

    # pkgin install abook lbdb mutt xlhtml

    # pkgin install 'php>=7.3<7.4'

Upgrade all packages:

    # pkgin upgrade

Remove packages and their reverse dependencies:

    # pkgin remove mutt

Remove orphaned dependencies:

    # pkgin autoremove

SEE ALSO
pkg_add(1), pkg_info(1), pkg_summary(5), pkgsrc(7)

AUTHORS

Emile <iMil> Heitor
    Initial work and ongoing development.

Jonathan Perkin
    Primary maintainer 0.9.0 onwards.

CONTRIBUTORS

Jeremy C. Reed
    Testing and refinements.

Arnaud Ysmal
    Tests and patches

Claude Charpentier
    SQLite schema, and SQL queries debugging.

Guillaume Lasmayous
    Man page

Antonio Huete Jimenez
    DragonFly port

Min Sik Kim
    Darwin port

Filip Hajny
    SunOS port

Baptiste Daroussin
    FreeBSD port and patches

Gautam B.T.
    MINIX port

Thomas <wiz> Klausner
    Testing and refinements.

Youri <yrmt> Mouton
    OSX testing and patches

BUGS
We're hunting them.