NetBSD-based distros

By admin, 28 April, 2025

Using pkgin for Binary Package Management

NAME

pkgin - A tool to manage pkgsrc binary packages. (NetBSD)

SYNOPSIS

[-dfFhPvVyn][-l limit_chars][-c chroot_path][-t log_file]command[package ...]

DESCRIPTION

The command is aimed at being an apt /yum like tool for managing pkgsrc binary packages. It relies onpkg_summary5for installation, removal and upgradeof packages and associated dependencies, using a remote repository.

OPTIONS

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 Displaysversion

-V Be verbose when (un)installing

-y Assumes "yes" as default answer, except for autoremove.

-n Assumes "no" as default answer.

-l limit_chars Only include the packages with the specified status flags.

-c chroot_path Enable chrooting pkgin in the given repository

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

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

full-upgrade Upgrade all packages to their newer versions present in therepository.

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

install package … Performs installation or upgrade ofpackage If more than one packages are specified on the command-line, allwill be installed (or upgraded).

keep package … Markspackageas "non auto-removable".This means that a package that has, for instance, been compiledmanually from pkgsrc, can't be removed through aupgrade.More than one package can be specified on the command-line, to markseveral packages as non-removable in a single command.

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

pkg-content package Show remotepackagecontent.

pkg-descr package Show remotepackagelong-description.

pkg-build-defs package Show remotepackagebuild definitions.

provides package Shows what apackageprovides to others

remove package … Removespackageas 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 apackagerequires from otherspackages

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

show-deps 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,will show recursively reverse direct dependencies for all packageson the command-line.

show-category category Show packages belonging tocategory

show-pkg-category package Showpackagecategory.

show-keep Display "non auto-removable" packages.

show-no-keep Display "auto-removable" packages.

unkeep package … Markspackageas "auto-removable".If no other package depends on it, it will be removed when usingthe autoremove modifier.

update Creates and populates the initial database of locally installed packagesand available packages (from the remotepkg_summary5list). This is done automatically when is first used, when the system package database has been modified. or when is upgraded to a new database version.

upgrade Upgrade keepable packages to their newer versions present in therepository.If the installed dependencies match the listed needed dependencies,don't upgrade them.

STATUS FLAGS

When using thelflag along with thelistcommand, the following status flag must be set:

= The installed version of the package is current.

> 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 ofspace separated repositories in order to override/usr/pkg/etc/pkgin/repositories.conf

FILES

/usr/pkg/etc/pkgin/repositories.conf

This file contains a list of repository URIs thatwill use.It may contain macros$archto define the machine hardware platformand$osreleaseto define the release version for the operating system(as reported byuname).

EXAMPLES

Setup the initial database:

# echo ftp://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All > /usr/pkg/etc/pkgin/repositories.conf# pkgin updateprocessing 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 scriptsaumix-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 editoraudacity-1.2.6nb3 Audio editor[...]

Install packages and their dependencies:

# pkgin install links etermnothing 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 eterm2 packages to delete: links-2.2nb1 eterm-0.9.4nb1proceed ? [y/N]

Remove orphan dependencies:

# pkgin autoremovein 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-6bnb4proceed ? [y/N]