[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pkg_*(1) manual pages.
From: |
Alfred M. Szmidt |
Subject: |
pkg_*(1) manual pages. |
Date: |
Mon, 10 May 2004 20:57:46 +0200 |
Here are the man-pages (juck) for the pkg_* commands avaiable in
OpenBSD, they might differ on other BSD's.
Note that I'm not advocating to use a setup similar to OpenBSD, this
is only a system I am familiar with nothing else.
===File ~/pkg_add.1=========================================
PKG_ADD(1) BSD General Commands Manual PKG_ADD(1)
NAME
pkg_add - install software package distributions
SYNOPSIS
pkg_add [-Inv] [-A arch] [-B pkg-destdir] [-f keys] [-L localbase]
[-P type] pkg-name [...]
DESCRIPTION
The pkg_add command is used to install packages created with the
pkg_create(1) command. Selected packages containing pre-compiled appli-
cations from the /usr/ports tree can be found on the OpenBSD FTP site or
on the official OpenBSD CD.
Note: System distribution files, e.g. base28.tgz, comp28.tgz, etc.,
are not packages and may not be installed using pkg_add.
Each package name may be specified as a filename (which normally consists
of the package name itself plus the ``.tgz'' suffix) or an URL referring
to FTP, HTTP, or SCP locations. For example, the following is valid:
pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/2.7/packages/i386/m4-1.4.tgz
If the given package names are not found in the current working direc-
tory, pkg_add will search for them in each directory named by the
PKG_PATH environment variable. Specifying '-' as a package name causes
pkg_add to read from the standard input.
Some packages may depend on other packages. When resolving dependencies
pkg_add will first look at already installed packages, then match depen-
dencies with the list of packages left to install, then install default
packages that satisfy the dependencies.
Alternatively, it is possible to add packages interactively from within
the ftp client, in which case setting PKG_PATH correctly will be neces-
sary for any dependency to be found out and retrieved the same way. For
example, the following works:
$ ftp ftp://ftp.openbsd.org/pub/OpenBSD/2.7/packages/i386/
250 CWD command successful
ftp> ls m*
227 Entering Passive Mode (129,128,5,191,164,73)
150 Opening ASCII mode data connection for m*.
m4-1.4.tgz
metamail-2.7.tgz
mh-6.8.4.tgz
mm-1.0.12.tgz
mpeg_lib-1.2.1.tgz
mpeg_play-2.4.tgz
mpg123-0.59q.tgz
mutt-0.95.7i.tgz
226 Transfer complete.
ftp> get m4-1.4.tgz "|pkg_add -v -"
Warning: Since the pkg_add command may execute scripts or programs con-
tained within a package file, your system may be susceptible to ``trojan
horses'' or other subtle attacks from miscreants who create dangerous
packages. Be sure the specified package(s) are from trusted sources.
The options are as follows:
-v Turn on verbose output.
-I If an installation script exists for a given package, do not
execute it.
-n Don't actually install a package, just report the steps that
would be taken if it was.
-A arch Assume arch as current machine architecture for any package
tests.
-B pkg-destdir
Set pkg-destdir as the prefix to prepend to any object extracted
from the package.
-f keys Force installation of the package. keys is a comma-separated
list of keywords that state what failsafes should be waived.
These include:
arch architecture recorded in package may not match.
conflicts
package may conflict with other packages.
installed
reinstall an existing package.
libdepends
library specifications may not be fullfilled.
nonroot install even if not running as root.
scripts install scripts may fail.
-L localbase
Install a package under localbase. By default, localbase equals
/usr/local, and specifying it is not necessary. However, pack-
ages can be created using a different localbase (see
pkg_create(1)), and those packages can only be installed by
using the same localbase. See bsd.port.mk(5) for a description
of LOCALBASE.
-P type Check permissions for distribution, where type can be 'cdrom' or
'ftp'.
By default, when adding packages via FTP, the ftp(1) program operates in
``passive'' mode. If you wish to use active mode instead, set the
FTPMODE environment variable to "active". If pkg_add consistently fails
to fetch a package from a site known to work, it may be because the site
does not support passive mode ftp correctly. This is very rare since
pkg_add will try active mode ftp if the server refuses a passive mode
connection.
Technical details
pkg_add extracts each package's ``packing information'' (the packing
list, description, and installation/deinstallation scripts) into a spe-
cial staging directory in /var/tmp (or PKG_TMPDIR if set - see CAVEATS
section) and then runs through the following sequence to fully extract
the contents of the package:
1. A check is made to determine if the package is already recorded as
installed. If it is, installation is terminated.
2. A check is made to determine if the package conflicts (from @pkgcfl
directives, see pkg_create(1)) with an already recorded as installed
package. If it is, installation is terminated.
3. For packages tagged with architecture constraints, pkg_add verifies
that the current machine architecture agrees with the constraints.
4. All package dependencies (from @pkgdep, @libdepend, and @newdepend
directives, see pkg_create(1)) are read from the packing list. If
any of these dependencies are not currently fullfilled, an attempt
is made to find a package that meets them and install it, looking
first in the list of packages to install passed to pkg_add; if no
adequate package can be found and installed, the installation is
terminated.
5. pkg_add checks for collisions with installed file names, read-only
file systems, and enough space to store files.
6. If the package contains a require script (see pkg_create(1)), it is
executed with the following arguments:
pkg-name The name of the package being installed
INSTALL Keyword denoting to the script that it is to run an
installation requirements check (the keyword is useful
only to scripts which serve multiple functions).
If the require script exits with a non-zero status code, the instal-
lation is terminated.
7. If the package contains an install script, it is executed with the
following arguments:
pkg-name The name of the package being installed.
PRE-INSTALL Keyword denoting that the script is to perform any
actions needed before the package is installed.
If the install script exits with a non-zero status code, the instal-
lation is terminated.
8. The packing list is used as a guide for extracting files from the
package into their final locations.
9. If an install script exists for the package, it is executed with the
following arguments:
pkg_name The name of the package being installed.
POST-INSTALL Keyword denoting that the script is to perform any
actions needed after the package has been installed.
10. After installation is complete, a copy of the packing list,
deinstall script, description, and display files are copied into
/var/db/pkg/<pkg-name> for subsequent possible use by pkg_delete(1).
Any package dependencies are recorded in the other packages'
/var/db/pkg/<other-pkg>/+REQUIRED_BY file (if the environment vari-
able PKG_DBDIR is set, this overrides the /var/db/pkg/ path shown
above).
11. Finally, the staging area is deleted and the program terminates.
Note that it is safe to interrupt pkg_add through SIGINT, as it will
safely record an interrupted install as borked.n.
ENVIRONMENT
PKG_PATH If a given package name cannot be found, the directories
named by PKG_PATH are searched. It should contain a series
of entries separated by colons. Each entry consists of a
directory name. The current directory may be indicated
implicitly by an empty directory name, or explicitly by a
single period ('.').
PKG_DBDIR Where to register packages instead of /var/db/pkg.
PKG_DESTDIR Value for pkg-destdir, if no -B option is specified; value
passed to any INSTALL or REQUIRE script invoked from the
package.
PKG_TMPDIR Temporary area where package information files will be
extracted, instead of /var/tmp.
SEE ALSO
pkg_create(1), pkg_delete(1), pkg_info(1), mkdtemp(3), sysconf(3),
mtree(8)
AUTHORS
Jordan Hubbard
Initial design.
Marc Espie
Complete rewrite.
CAVEATS
Package extraction does need a temporary area that can hold executable
scripts.
pkg_add looks through ${PKG_TMPDIR}, ${TMPDIR}, /var/tmp, /tmp, /usr/tmp
for such an area, in sequence.
If ${TMPDIR} and /var/tmp are mounted noexec, you must currently set
PKG_TMPDIR to a suitable area, as pkg_add does not check for noexec sta-
tus except by failing to run installation scripts.
BSD November 25, 1994 BSD
============================================================
===File ~/pkg_delete.1======================================
PKG_DELETE(1) BSD General Commands Manual PKG_DELETE(1)
NAME
pkg_delete - a utility for deleting previously installed software package
distributions
SYNOPSIS
pkg_delete [-cDnqv] [-B pkg-destdir] [-f keys] pkgname [...]
DESCRIPTION
The pkg_delete command is used to delete packages that have been previ-
ously installed with the pkg_add(1) command.
Package names may be specified either as the package name itself, or as a
filename which consists of the package name plus the ``.tgz'' suffix, or
as a full pathname like /var/db/pkg/pkgname, so that shell wildcards can
be used.
Version numbers and flavors (see packages-specs(7)) can be omitted,
unless the resulting specification is ambiguous.
The options are as follows:
-B pkg-destdir Set pkg-destdir as the prefix to prepend to any object
deleted.
-v Turn on verbose output.
-D If a deinstallation script exists for a given package, do
not execute it.
-n Don't actually deinstall a package, just report the steps
that would be taken if it were.
-f keys Force removal of the package. keys is a comma-separated
list of keywords that state what failsafes should be
waived. These include:
ambiguous
delete all packages matching ambiguous package
specifications.
dependencies
also delete the whole set of packages that
depends upon the requested packages.
nonroot uninstall even if not running as root.
uninstalled
proceed even if some package names don't resolve
to installed package names.
-c Delete extra configuration file, mentioned as
@extra file
in the packing-list.
-q Delete package quickly, do not bother checking md5s
before removing files.
TECHNICAL DETAILS
pkg_delete examines installed package records for the pkgname specified,
checks inter-dependencies between installed packages, deletes the package
contents in an order respecting dependencies (e.g., packages with depen-
dencies get removed first), and finally removes the package records.
If a package is required by other installed packages not mentioned in the
list of packages to remove, pkg_delete will list those dependent packages
and refuse to delete the package.
If the package contains a require file (see pkg_create(1)), then this is
executed first as
require <pkg-name> DEINSTALL
(where pkgname is the name of the package in question and DEINSTALL is a
keyword denoting that this is a deinstallation) to see whether or not
deinstallation should continue. A non-zero exit status means no, unless
the -f option is specified.
If a deinstall script exists for the package, it is executed before any
files are removed. Such a script can be used to remove messy dynamic
files created by the package on installation or during usage. The
deinstall script is called as:
deinstall <pkg-name> DEINSTALL
Passing the keyword DEINSTALL lets you potentially write only one pro-
gram/script that handles all aspects of installation and deletion.
ENVIRONMENT
PKG_DBDIR Where to look for installed packages instead of /var/db/pkg.
PKG_DESTDIR Value for pkg-destdir, if no -B option is specified; value
passed to any DEINSTALL or REQUIRE script invoked from the
package.
SEE ALSO
pkg_add(1), pkg_create(1), pkg_info(1), mkstemp(3), mtree(8)
AUTHORS
Jordan Hubbard
initial design
Marc Espie
complete rewrite
BSD November 25, 1994 BSD
============================================================
===File ~/pkg_create.1======================================
PKG_CREATE(1) BSD General Commands Manual PKG_CREATE(1)
NAME
pkg_create - a utility for creating software package distributions
SYNOPSIS
pkg_create [-hv] [-A arches] [-B pkg-destdir] [-P dpkgs] [-C cpkgs]
[-p prefix] [-i iscript] [-k dscript] [-r rscript]
[-S pkg-destdir] [-D displayfile] [-L localbase] -c comment -d
description -f packlist pkg-name
DESCRIPTION
The pkg_create command is used to create packages that will subsequently
be fed to one of the package extraction/info utilities. The input
description and command line arguments for the creation of a package are
not really meant to be human-generated, though it is easy enough to do
so. It is more expected that you will use a front-end tool for the job
rather than muddling through it yourself. Nonetheless, a short descrip-
tion of the input syntax is included in this document.
The options are as follows:
-A arches
Register a list of architectures for which this package should
install. arches is a comma-separated list of architectures. Use
'*' to mean any architecture (e.g., arch-independent packages).
-f packinglist
Fetch ``packing list'' for package from the file packinglist or
stdin if packinglist is a dash ``-''.
-c [-]desc
Fetch package ``one line description'' from file desc or, if pre-
ceded by ``-'', the argument itself. This string should also
give some idea of which version of the product (if any) the pack-
age represents.
-d [-]desc
Fetch long description for package from file desc or, if preceded
by ``-'', the argument itself.
-v Turn on verbose output.
-h Force tar to follow symbolic links, so that the files they point
to are dumped, rather than the links themselves (deprecated).
-i iscript
Set iscript to be the install procedure for the package. This
can be any executable program (or shell script). It will be
invoked automatically when the package is later installed.
-P dpkgs
Set the initial package dependency list to dpkgs (deprecated).
-C cpkgs
Set the initial package conflict list to cpkgs (deprecated).
-p prefix
Set prefix as the initial directory ``base'' to start from in
selecting files for the package, and to record as the base for
installing the package.
-S pkg-destdir
-B pkg-destdir
Set pkg-destdir as the prefix to prepend to any file to select
for the package. Prefer -B.
-L localbase
Record localbase as the localbase used in the package. By
default, /usr/local. Packages built with another localbase can
only be installed by using the same localbase in pkg_add(1), to
prevent errors.
-k dscript
Set dscript to be the de-install procedure for the package. This
can be any executable program (or shell script). It will be
invoked automatically when the package is later (if ever) de-
installed.
-r rscript
Set rscript to be the ``requirements'' procedure for the package.
This can be any executable program (or shell script). It will be
invoked automatically at installation/deinstallation time to
determine whether or not installation/deinstallation should pro-
ceed.
-D displayfile
Display the file (using more(1)) after installing the package.
Useful for things like legal notices on almost-free software,
etc.
PACKING LIST DETAILS
The ``packing list'' format (see -f) is fairly simple, being nothing more
than a single column of filenames to include in the package. However,
since absolute pathnames are generally a bad idea for a package that
could be installed potentially anywhere, there is another method of spec-
ifying where things are supposed to go and, optionally, what ownership
and mode information they should be installed with. This is done by
imbedding specialized command sequences in the packing list. Briefly
described, these sequences are:
@arch arches
List of architectures for which this package is intended.
@cwd directory
Set the internal directory pointer to point to directory. All
subsequent filenames will be assumed relative to this directory.
Note: @cd is also an alias for this command.
@exec command
Execute command as part of the unpacking process. If command
contains any of the following sequences somewhere in it, they
will be expanded inline. For the following examples, assume that
@cwd is set to /usr/local and the last extracted file was
bin/emacs.
%F Expands to the last filename extracted (as specified); in
the example case, bin/emacs.
%D Expands to the current directory prefix, as set with
@cwd; in the example case /usr/local.
%B Expands to the ``basename'' of the fully qualified file-
name, that is the current directory prefix, plus the last
filespec, minus the trailing filename. In the example
case, that would be /usr/local/bin.
%f Expands to the ``filename'' part of the fully qualified
name, or the converse of %B; in the example case, emacs.
@unexec command
Execute command as part of the deinstallation process. Expansion
of special % sequences is the same as for @exec. This command is
not executed during the package add, as @exec is, but rather when
the package is deleted. This is useful for deleting links and
other ancillary files that were created as a result of adding the
package, but not directly known to the package's table of con-
tents (and hence not automatically removable). The advantage of
using @unexec over a deinstallation script is that you can use
the ``special sequence expansion'' to get at files regardless of
where they've been potentially redirected (see -p).
@mode mode
Set default permission for all subsequently extracted files to
mode. Format is the same as that used by the chmod command
(well, considering that it's later handed off to it, that's no
surprise). Use without an arg to set back to default (extrac-
tion) permissions.
@owner user
Set default ownership for all subsequently extracted files to
user. Use without an arg to set back to default (extraction)
ownership.
@group group
Set default group ownership for all subsequently extracted files
to group. Use without an arg to set back to default (extraction)
group ownership.
@comment string
Imbed a comment in the packing list. Useful in trying to docu-
ment some particularly hairy sequence that may trip someone up
later.
@ignore
Used internally to tell extraction to ignore the next file (don't
copy it anywhere), as it's used for some special purpose.
@localbase
Used internally to record the settings of -L option.
@name name
Set the name of the package. This is mandatory and is usually
put at the top. This name is potentially different than the name
of the file it came in, and is used when keeping track of the
package for later deinstallation. Note that pkg_create will
derive this field from the package name and add it automatically
if none is given.
@dirrm name
Declare directory name to be deleted at deinstall time. By
default, directories created by a package installation are not
deleted when the package is deinstalled; this provides an
explicit directory cleanup method. This directive should appear
at the end of the package list. If more than one @dirrm direc-
tive is used, the directories are removed in the order specified.
The name directory will not be removed unless it is empty.
@extra file
Declare extra file file to be deleted at deinstall time, if user
sets -c option. Those files are extra configuration files that
are normally not deleted. If file ends with a slash, it is a
directory.
@extraunexec command
Extra command to execute when removing extra files.
@display name
Declare name as the file to be displayed at install time (see -D
above).
@pkgdep pkgname
Declare a dependency on the pkgname package. The pkgname package
must be installed before this package may be installed, and this
package must be deinstalled before the pkgname package is dein-
stalled. Multiple @pkgdep directives may be used if the package
depends on multiple other packages.
@pkgcfl pkgcflname
Declare a conflict to the pkgcflname package. The pkgcflname
package must not be installed if pkgname package gets installed
because they install the same files and thus conflict.
pkgcflname may use fnmatch(3) wildcards.
@option name
Effects vary depending on name. Some options are not documented
yet.
no-default-conflict
By default, a package conflicts with other versions of
the same package. With this option, the older package
version will still be noticed, but the installation will
proceed anyway.
ENVIRONMENT
PKG_DESTDIR Default value for pkg-destdir, if no -B or -S option is
specified.
SEE ALSO
pkg_add(1), pkg_delete(1), pkg_info(1), sysconf(3)
HISTORY
The pkg_create command first appeared in FreeBSD.
AUTHORS
Jordan Hubbard
initial design
Marc Espie
complete rewrite.
BSD April 21, 1995 BSD
============================================================
===File ~/pkg_info.1========================================
PKG_INFO(1) BSD General Commands Manual PKG_INFO(1)
NAME
pkg_info - a utility for displaying information on software packages
SYNOPSIS
pkg_info [-cDdfIikLmpqRrvh] [-e package] [-l prefix] pkg-name [...]
pkg_info [-a flags]
DESCRIPTION
The pkg_info command is used to dump out information for packages, as
created by pkg_create(1), which may be still packed up or already
installed on the system with the pkg_add(1) command.
The pkg-name may be the name of an installed package, the pathname to a
package distribution file, or a URL to a package available through ftp,
http, or scp. pkg_info will try to complete pkg-name with a version num-
ber while looking through installed packages.
The following command-line options are supported:
-a Show information for all currently installed packages.
-c Show the one-line comment field for each package.
-D Show the install-message file (if any) for each package.
-d Show the long-description field for each package.
-e pkg-name
This option allows you to test for the presence of another (per-
haps prerequisite) package from a script. If the package identi-
fied by pkg-name is currently installed, return 0, otherwise
return 1. In addition, the names of any package(s) found
installed are printed to stdout unless turned off using the -q
option.
If the given pkg-name contains a shell meta-character, it will be
matched against all installed packages using fnmatch(3). csh(1)
style ``{,}'' alternates have also been implemented in addition
to this. Package version numbers can also be matched in a rela-
tional manner using the ``>='', ``<='', ``>'', and ``<'' opera-
tors. For example, pkg_info -e 'name>=1.3' will match versions
1.3 and later of the name package.
-f Show the packing list instructions for each package.
-I Show the index entry for each package.
-i Show the install script (if any) for each package.
-k Show the de-install script (if any) for each package.
-L Show the files within each package. This is different from just
viewing the packing list, since full pathnames for everything are
generated.
-l str Prefix each information category header (see -q) shown with str.
This is primarily of use to front-end programs that want to
request a lot of different information fields at once for a pack-
age, but don't necessary want the output intermingled in such a
way that they can't organize it. This lets you add a special
token to the start of each field.
-m Show the mtree file (if any) for each package.
-p Show the installation prefix for each package.
-q Be ``quiet'' in emitting report headers and such, just dump the
raw info (basically, assume a non-human reading).
-R Show which packages require a given package.
-r Show the requirements script (if any) for each package.
-v Turn on verbose output.
ENVIRONMENT
PKG_DBDIR The standard package database directory, /var/db/pkg, can be
overridden by specifying an alternative directory in the
PKG_DBDIR environment variable.
PKG_PATH This can be used to specify a colon-separated list of paths
to search for package files. The current directory is always
searched first, even if PKG_PATH is set. If PKG_PATH is
used, the suffix ``.tgz'' is automatically appended to the
pkg-name, whereas searching in the current directory uses
pkg-name literally.
PKG_TMPDIR Temporary area where package information files will be
extracted, instead of /var/tmp.
TECHNICAL DETAILS
Package info is either extracted from package files named on the command
line, or from already installed package information in
/var/db/pkg/<pkg-name>.
SEE ALSO
pkg_add(1), pkg_create(1), pkg_delete(1), mkstemp(3), mtree(8)
AUTHORS
Jordan Hubbard
initial design
Marc Espie
complete rewrite
BSD August 22, 1998 BSD
============================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- pkg_*(1) manual pages.,
Alfred M. Szmidt <=