You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

701 lines
22 KiB

.\" man page for prt-get
.\" original work by Johannes Winkelmann, jw at tks6 dot net
.\" revised 2022 by John McQuah, jmcquah at disroot dot org
.\" .PU
.TH "prt-get" "8" "" "" ""
prt\-get \- an advanced package management tool to be used with
pkgutils from CRUX (see
.B prt\-get command [options] <arguments>
prt\-get is a package management tool which provides additional
functionality to the CRUX package management system. It works with the
local ports tree and is therefore fully compatible with ports(8) and
pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features:
\ \ \ \(bu
abstract ports installation/update from file system
\ \ \ \(bu
install/update a list of packages with one command
\ \ \ \(bu
list dependencies for a list of packages
\ \ \ \(bu
show information about ports
\ \ \ \(bu
search within the ports
What prt\-get basically does is build, install/upgrade, and remove packages, using
pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's
directory to call prt\-get. prt\-get will search for the respective port
itself in a list of directories specified in /etc/prt\-get.conf. This
allows you to just install or update a package, without caring where
it actually is located on your file system.
prt\-get also lets you search for ports by name,
find information about ports (without installing them of course),
or print the dependencies of a port (as a space- or newline-separated list,
or a formatted tree). Note that dependencies are no
requirement for crux packages and therefore not always accurate.
prt\-get has a test mode so you can see what effect an install/update
operation would have. Use the \-\-test switch for this (more details in
the \fBOPTIONS\fP section below).
prt\-get returns 0 on success and a non-zero value otherwise (exact
value -> meaning mapping to be determined...)
prt\-get uses so\-called commands, which always have to be the first
non-option argument passed. This is very similar to
.B cvs(1).
[command] can be one of the following:
.B install [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
install all packages in the listed order. Note that you can do this
from any directory.
.B depinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
install all packages in the listed order including their dependencies.
Note that already-installed packages will be left at their current version,
even if out of date. prt\-get depinst behaves this way because all of its
child pkgadd processes will \fBlack\fP the \-u flag, which is needed when
updating an already-installed package.
.B grpinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
install all packages in the listed order, but stop if installation of
one package fails. This can be used to install packages where package2
depends on package1.
.B update [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
update all packages listed in this order. Note: if the latest version of
a package has acquired dependencies that were not needed by the currently-installed
version and are not present on the system, the update command will not attempt to
resolve this omission. prt\-get update behaves this way because pkgadd invocations
inherit the flag \-u for every package in the transaction, causing an error if the package
is not already installed. You can follow the CRUX mailing list or the IRC channels to stay informed
of the situations where an update will require manual intervention, or filter the output of
.B prt\-get quickdep $(prt\-get quickdiff)
through \fBprt\-get isinst\fP to get a list of packages suitable for an \fBinstall\fP or
\fBupdate\fP command. See the \fBEXAMPLES\fP section below for details.
.B remove <package1> [<package2> ...]
remove packages listed in this order
.B sysup [\-\-nodeps]
Update all installed packages which are outdated. Sorts by dependencies
by default. Passing the --nodeps switch tells prt\-get not to sort by dependencies,
for approximately the same effect as
.B prt\-get update $(prt\-get quickdiff).
As with an \fBupdate\fP command, the child \fBpkgadd\fP processes will inherit the
\-u flag, so any dependencies that have been added since the currently-installed version
of a port are omitted from the transaction (unless they happen to be installed for some other
reason). See the \fBEXAMPLES\fP section for a way to automate the resolution of such omissions.
Also see the
.B lock
.B unlock
commands to keep the currently installed versions, even if there are
changes in the ports tree. If you want to update only diffs which have
a lower version installed than the one in the ports tree, use the
--prefer-higher option.
.B lock <package1> [<package2>...]
Do not update these packages in a
.B sysup
.B unlock <package1> [<package2>...]
Remove lock from these packages
.B listlocked [-v|-vv]
List names of packages which are locked. As always,
.B -v
will additionally show the version, and
.B -vv
also includes the description from the Pkgfile. Note that the
.B -vv
switch will slow down the operation remarkably.
.B diff [\-\-all] [\-\-prefer\-higher] [<package1> <package2> ...]
show differences between installed packages and ports in the ports
tree. If arguments are given, shows only differences for these
packages, otherwise all differences are shown. It's also possible to use
.B wildcards
for the diff command. Make sure you escape where needed. Locked
packages are only displayed if you use the --all switch. If you want
to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option.
.B quickdiff
prints a simple list of packages which have a different version in the
ports tree than what is installed. The output is sorted alphabetically,
but you can generate a (larger) list sorted by dependencies using
.B prt\-get quickdep $(prt\-get quickdiff).
Note that the resulting list is usually a mix of installed and not-installed packages,
so it must be filtered by
.B prt\-get isinst
before being passed as argument to prt\-get install or prt\-get update. See the
section below.
If you want to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option.
.B search [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
Search the ports tree for
.B expr
in their name
.B dsearch [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
Search the ports tree (both name and description) for the pattern
.B expr
(which can be a shell-like wildcard pattern or a regexp). The search in
the description is not case sensitive. Note that this requires prt\-get
to read every Pkgfile, which makes it rather slow; if you like this,
consider using the cache functionality, so you only have to spend this
time once after updating the ports tree has been updated.
.B fsearch [\-\-full] [\-\-regex] <pattern>
Search the ports tree for
.B pattern
as file name in their footprint. When called without '--full', strips
the directories from the file names before matching; this behaviour
will change in prt-get 0.6, where full path search will be the
default. Pattern can be a shell-like wildcard pattern (e.g. prt-get
fsearch "*.h") or a regular expression (e.g. prt-get fsearch --regex 'liblz(o2|ma).*')
.B info <port>
Print available info for a port
.B path <port>
Print the path of a port
.B readme <port>
Print the port's README file if it exists; if set, uses $PAGER
.B depends <package1> [<package2> ...]
print a recursive list of dependencies needed to install the packages passed
as argument. It shows a list of the dependencies that were found in the ports tree,
plus a list of the dependencies that could not be found.
.B quickdep <package1> [<package2> ...]
print a simple list of recursive dependencies for all the packages passed
as argument. The output is formatted to be useful in command substitution, e.g. instead of
.B prt\-get depinst xorg-server
you might obfuscate your intentions with a gratuitous loop:
.B for i in $(prt\-get quickdep xorg-server); do prt\-get isinst $i || prt\-get install $i; done
Note: output is restricted to those dependencies that can be found in the ports tree. It might be
useful to run
.B prt\-get depends <package1> | grep \(dq\-\- missing packages\(dq
as a first step, in order to ensure that your ports tree has everything needed for successful
.B deptree <package>
print a tree of the dependencies of the package
.B package.
Subtrees already shown are marked with '-->' to save some space. In
order to show them all, add the --all switch.
.SH ""
Note that soft (optional) dependencies are NOT considered when running
prt\-get depends, prt\-get quickdep, or prt\-get deptree. The port maintainer
often provides a README if significant loss of functionality might result from
not having an optional dependency present when building, so be sure to interpret the output of
.B prt\-get <depends|quickdep|deptree>
in light of the information provided in such a README.
.B dependent <package>
print a list of ports which have
.B package
in their "Depends on:" line. As with
.B depends, quickdep, deptree,
the Pkgfile line for soft (optional) dependencies is NOT parsed during this operation,
so the output might omit some of the ports that were linked against
.B package
during compilation.
By default, output is restricted to ports that are installed. To see all hard dependencies,
add the --all switch; use --recursive to get a recursive list (without duplication),
and --tree to get a nicely indented one.
.B dup [-v] [format]
List ports which can be found in multiple directories configured in
.B /etc/prt-get.conf
Use the verbose switch to simulate the output of version 5.12 and older (likely
to go away in the future). The format string can be used to create user
specified formats. The following symbols are currently replaced:
\ \ \ \(bu
%n \-> name of the port
\ \ \ \(bu
%p1 \-> Full path (including name) to port taking precendence
\ \ \ \(bu
%p2 \-> Full path (including name) to port being hidden
\ \ \ \(bu
%v1 \-> Version of port taking precendence
\ \ \ \(bu
%v2 \-> Version of port being hidden
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
List ports available in the ports tree. It's basically the same as
.B ports \-l
but looks in all directories specified in
.B /etc/prt\-get.conf.
It's also possible to use shell-like
.B wildcards
for the list command. Make sure you escape where needed
.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
Print formatted port list format string can contain variables, which
are replaced like this:
\ \ \ \(bu
%n \-> name
\ \ \ \(bu
%p \-> path
\ \ \ \(bu
%v \-> version
\ \ \ \(bu
%r \-> release
\ \ \ \(bu
%d \-> description
\ \ \ \(bu
%e \-> dependencies
\ \ \ \(bu
%u \-> URL
\ \ \ \(bu
%P -> Packager
\ \ \ \(bu
%M -> Maintainer
\ \ \ \(bu
%R -> Readme ("yes"/"no")
\ \ \ \(bu
%E -> pre-install script ("yes"/"no")
\ \ \ \(bu
%O -> post-install script ("yes"/"no")
\ \ \ \(bu
%l -> is locked ("yes"/"no")
\ \ \ \(bu
%i \-> "no" if not installed, "yes" if it's installed and
up to date and "diff" if it's installed and a new version is in the
ports tree.
Use "\\n" and "\\t" to format your output (no additional format specified
suported). The optional format string2 can contain the same variables
as format string1 and is used to sort the output. You can specify a
.B wildcard filter
to filter by package name.
.B listinst [\-v|\-vv] [\-\-regex] [\-\-depsort] [filter]
List installed ports. It's basically the same as
.B pkginfo \-i,
but omits version when called without verbose (\-v, \-vv) switch. Plus
it is notably faster in my tests. \-v adds version information, \-vv
adds version and description.
.B Warning:
\-vv will slow down the process because it requires prt\-get to scan
both the ports database and the ports tree.
It's also possible to use shell-like
.B wildcards
for the listinst command. Make sure you escape where needed. By default
it's sorted alphabetically; use the \-\-depsort switch to sort by
.B listorphans [\-v|\-vv]
List installed ports which do not appear in the "Depends on:" line of
any other port currently installed. Output appears alphabetically separated by newlines, making it
suitable for process substitution as shown in the
section below. Note that some core ports might be runtime
dependencies despite their absence in the "Depends on:" line; see \fBPkgfile(5)\fP
for an explanation of this practice. Also remember that this operation does NOT account for soft
(optional) dependencies. Removing a non-core package returned by this command might require a
rebuild of other packages; use revdep(1) to locate such breakage.
.B isinst <package1> [<package2> ...]
Check whether each package given on the command line is installed. Output in the case of multiple
arguments is separated by newlines, suitable for processing by awk or grep. Similar to
.B pkginfo \-i|grep \-E '^(package1|package2|...)'
but does not print the version information. This command has a return value of 0 if
all packages given as argument are installed, otherwise a return value greater than 0.
.B current <package>
Shows the currently-installed version of <package>, or a message
that <package> is not installed. Unlike
.B prt\-get isinst package1 package2,
this command does \fBnot\fP accept more than one package as argument. Use
.B pkginfo \-i| grep \-E '^(package1|package2|...)'
to work around this limitation.
.B ls [--path] <package>
Prints out a listing of the port's directory
.B cat <package> [<file>]
Prints out the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER.
.B edit <package> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used.
.B help
Shows a help screen
.B dumpconfig
Dump the configuration to the current terminal
.B version
Shows the current version of prt\-get
.B cache
create a cache file from the ports tree to be used by prt\-get using the
\-\-cache option. Remember to run prt\-get cache each time you update the
ports tree.
The following options are primarily useful for install/update transactions.
.B -f, -i
Force install; Implies 'pkgadd -f'; same as --aargs=-f
.B -fr
Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
.B -um
Update md5sum, implies 'pkgmk -um'; same as --margs=-um
.B -im
Ignore md5sum, implies 'pkgmk -im'; same as --margs=-im
.B -us
Update signature, implies 'pkgmk -us'; same as --margs=-us
.B -is
Ignore signature, implies 'pkgmk -is'; same as --margs=-is
.B -uf
Update footprint, implies 'pkgmk -uf'; same as --margs=-uf
.B -if
Ignore footprint, implies 'pkgmk -if'; same as --margs=-if
.B -ns
No stripping, implies 'pkgmk -ns'; same as --margs=-ns
.B -kw
Keep working directory, implies 'pkgmk -kw'; same as --margs=-kw
.B \-\-margs="...", e.g. \-\-margs="\-im"
additional arguments to be passed to pkgmk;
note that \-d is already passed to pkgmk anyway
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
additional arguments to be passed to pkgadd
.B \-\-rargs="..."
arguments to be passed to pkgrm; currently not used, implemented for
future uses and consistency reasons
.B --ignore=<package1,package2,...>
Don't install these packages, even if they're listed as dependencies
.B \-\-cache
Use cache file for this command
.B \-\-test
Dry run, don't actually install anything, mostly interesting for
.B prt\-get install, prt\-get grpinst, prt\-get update, prt\-get sysup
.B \-\-pre-install
Execute pre-install script if it's there
.B \-\-post-install
Execute post-install script if it's there
.B \-\-install-scripts
Execute pre-install and post-install script if they're there
.B \-\-install-root=<dir>
Use <dir> as root directory for your installation; allows you to install the requested packages
onto a different directory than '/'. In daily usage, this option is not required; it's primarily
interesting if you're developing an independent installation.
The setting for --install-root determines which package database is used for reading/writing (so
<dir>/var/lib/pkg/db must exist), and where the pkg.tar.?z archives get unpacked, but the
relevant prt\-get.conf and ports tree are those on the parent filesystem. Therefore it is not
necessary for <dir> to contain its own copy of the ports tree, or even a copy of prt-get.conf.
However, if <dir>/etc/pkgadd.conf exists and is different from /etc/pkgadd.conf, then install or
update commands might behave unexpectedly. In order to preserve the \fBpkgadd.conf(5)\fP settings
from the host system, append the option --aargs='-c /etc/pkgadd.conf' to your \fBprt-get install\fP
command, or just copy the desired directives into <dir>/etc/pkgadd.conf .
.B \-\-log
Write build output to log file
.B \-\-no-std-config
Don't parse the default configuration file
.B \-\-config-prepend=<string>
Prepend <string> to configuration
.B \-\-config-append=<string>
Append <string> to configuration
.B \-\-config-set=<string>
Set <string> in configuration, overriding configuration file
.B \-\-config=<file>
Use alternative configuration file to read ports directories from
.SH ""
The following options are primarily useful for non-install (information-seeking) transactions,
although some of them affect the behaviour of install/upgrade transactions as well.
.B \-v, \-vv
(verbosity level) Show version of a port (\-v), or show both version
and description (\-vv). Passing more than one of these options is equivalent to \-vv.
.B \-\-path
Show path info for the ports found by a search or a dependency calculation
.B \-\-regex
Interpret filter and search pattern as regular expression
.B \-\-prefer\-higher, \-ph
Make prt-get parse the version strings and prefer the higher version,
even if the one found in the ports tree is lower. Also used during
a sysup operation.
.B \-\-strict\-diff, \-sd
Override the 'preferhigher' configuration option
See man prt\-get.conf(5)
.B prt\-get install irssi
Download, build and install irssi, with one simple command
.B prt\-get install paper yasm
Install paper and yasm. Abort with an informative error message if either package is already
installed, allowing you to issue a revised command.
.B prt\-get update bmake cmake
Update bmake and cmake. Abort with an informative error message if either package is not yet
installed, allowing you to issue a revised command.
.B prt\-get update -fr openssh
Update your current version of openssh, forcing a rebuild even if no version difference is detected.
Useful if there was a major version change in one of its dependencies, and \fBrevdep openssh\fP
indicates a broken package. :\-)
.B MISSLIBS=$(revdep -vvv mpv | awk -F ':' '/(missing library)/ {print $3}'); [ -n \(dq${MISSLIBS[@]}\(dq ] && for i in ${MISSLIBS[@]}; do prt\-get fsearch $i; done
(adapted from a script by ppetrov^) Check for the presence of the runtime libraries needed by mpv.
If any are absent, search the footprints to determine which ports provide the missing libraries.
.B prt\-get search --regex '^(m|n|p)c.*'
Return a list of all ports whose names start with "mc", "nc", or "pc"
.B prt\-get dsearch irc
Return a list of all ports having "irc" in their name or description
.B comm -13 <(ls /usr/ports/core) <(prt-get listorphans)
(based on comments from Romster and jue) Filter out the core ports from the list of orphans, in
shells (like bash) that support process substitution
.B comm -13 <(cat ~/.keepers <(ls /usr/ports/core) | sort) <(prt\-get listorphans) | xargs prt\-get remove
(system-hosing extension of the above) A one-liner inspired by \fBpkg\-clean\fP
and \fBpkgfoster\fP, but without the safeguard of interactivity. \fBDo not try this on a
mission-critical system.\fP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/not installed/ {print $2}'
(adapted from a comment by Fun) After updating your ports tree, print out a list of dependencies
that were not needed the last time you built your currently-installed ports, but are needed now by
the newer versions of these ports. The output of this command is sorted by dependencies, therefore
suitable for piping to \fBxargs prt\-get install\fP or \fBxargs prt\-get grpinst\fP.
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/is installed/ {print $2}'
Same as above, but only print the dependencies that are already installed. The output of this
command is suitable for piping to \fBxargs prt\-get update\fP.
.B prt\-get printf \(dq%p\et%u\en\(dq | grep myrepo | cut -f 2
Print the upstream URL for each port in the collection \(dqmyrepo\(dq, perhaps as the first step in
keeping your personal overlay up to date.
.B prt\-get printf \(dq%M\et%n\en\(dq | grep ^Tim | wc -l
Count how many ports our most-overworked core team member claims responsibility for.
.B comm -13 <(prt\-get depends firefox-bin |tail -n +2 |sort) <(prt\-get depends firefox |tail -n +2 |sort)
Find the build-time dependencies of firefox. Runtime dependencies would also appear in the list generated by
the first process substitution, and \fBcomm -13\fP will suppress what the two lists have in common.
.B prt-get listinst \-\-depsort | xargs prt-get grpinst \-\-install\-root=/mnt
Sort the list of installed packages by dependencies, and then install all
those packages onto a backup filesystem (mounted at /mnt). If you have a customized
pkgadd.conf that you want applied to this operation, either copy it to
/mnt/etc where pkgadd will be looking for it, or pass the additional option \-\-aargs=\(dq\-c
/etc/pkgadd.conf\(dq to the grpinst command.
.B prt-get list --path --regex '^xorg.*' | grep -v "/usr/ports/xorg"
Show the ports whose names begin with xorg, but which appear outside the xorg port collection.
(At the time of writing, this command returned at least two font ports.)
Johannes Winkelmann <>, and others cited inline
prt\-get.conf(5), prt\-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8)