.\" Generated by scdoc 1.11.4 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "apk" "8" "2025-12-17" .PP .SH NAME .PP apk - Alpine Package Keeper .PP .SH SYNOPSIS .PP \fBapk\fR [<\fIglobal options\fR>.\&.\&.\&] \fIcommand\fR [<\fIoptions\fR>.\&.\&.\&] [<\fIarguments\fR>.\&.\&.\&] .PP .SH DESCRIPTION .PP \fBapk\fR manages packages installed on the system.\& The set of top level constraints on system packages is called the \fIworld\fR (see \fBapk-world\fR(5)).\& .PP \fBapk\fR supports various sub-commands to query and manipulate \fIworld\fR and package repositories.\& .PP All apk commands which modify the database are logged to /var/log/apk.\&log.\& .PP By default apk is non-interactive.\& See \fBFILES\fR or \fB--interactive\fR on changing this default to be interactive.\& .PP Only \fIglobal options\fR should be specified before \fIcommand\fR.\& For backwards compatilibity a best effort attempt is made to parse applet specific options before the \fIcommand\fR, but this is deprecated and subject to be removed.\& .PP .SH COMMANDS .PP Each command is documented in detail on its manual page.\& .PP .SS PACKAGE INSTALLATION AND REMOVAL .PP .TS l lx l lx. T{ \fBapk-add\fR(8) T} T{ Add or modify constraints in \fIworld\fR and commit changes T} T{ \fBapk-del\fR(8) T} T{ Remove constraints from \fIworld\fR and commit changes T} .TE .sp 1 .SS SYSTEM MAINTENANCE .PP .TS l lx l lx l lx l lx. T{ \fBapk-fix\fR(8) T} T{ Fix, reinstall or upgrade packages without modifying \fIworld\fR T} T{ \fBapk-update\fR(8) T} T{ Update repository indexes T} T{ \fBapk-upgrade\fR(8) T} T{ Install upgrades available from repositories T} T{ \fBapk-cache\fR(8) T} T{ Manage the local package cache T} .TE .sp 1 .SS QUERYING PACKAGE INFORMATION .PP .TS l lx l lx l lx l lx l lx l lx. T{ \fBapk-query\fR(8) T} T{ Query information about packages by various criteria T} T{ \fBapk-list\fR(8) T} T{ List packages matching a pattern or other criteria T} T{ \fBapk-dot\fR(8) T} T{ Render dependencies as graphviz graphs T} T{ \fBapk-policy\fR(8) T} T{ Show repository policy for packages T} T{ \fBapk-search\fR(8) T} T{ Search for packages by name or description T} T{ \fBapk-info\fR(8) T} T{ Give detailed information about packages or repositories T} .TE .sp 1 .SS REPOSITORY AND PACKAGE MAINTENANCE .PP .TS l lx l lx l lx l lx l lx l lx l lx l lx. T{ \fBapk-mkndx\fR(8) T} T{ Create repository index (v3) file from packages T} T{ \fBapk-mkpkg\fR(8) T} T{ Create package (v3) T} T{ \fBapk-index\fR(8) T} T{ Create repository index (v2) file from packages T} T{ \fBapk-fetch\fR(8) T} T{ Download packages from repositories to a local directory T} T{ \fBapk-manifest\fR(8) T} T{ Show checksums of package contents T} T{ \fBapk-extract\fR(8) T} T{ Extract package file contents T} T{ \fBapk-verify\fR(8) T} T{ Verify package integrity and signature T} T{ \fBapk-adbsign\fR(8) T} T{ Sign, resign or recompress v3 packages and indexes T} .TE .sp 1 .SS MISCELLANEOUS .PP .TS l lx l lx l lx l lx l lx l lx l lx. T{ \fBapk-audit\fR(8) T} T{ Audit system for changes T} T{ \fBapk-stats\fR(8) T} T{ Show statistics about repositories and installations T} T{ \fBapk-version\fR(8) T} T{ Compare package versions or perform tests on version strings T} T{ \fBapk-adbdump\fR(8) T} T{ Dump v3 files in textual representation T} T{ \fBapk-adbgen\fR(8) T} T{ Generate v3 files from text representation T} T{ \fBapk-convdb\fR(8) T} T{ Convert v2 installed database to v3 format T} T{ \fBapk-convndx\fR(8) T} T{ Convert v2 indexes to v3 format T} .TE .sp 1 .SH OPTION SYNTAX .PP The \fIBOOL\fR argument for options is '\&\fByes\fR'\& or '\&\fBno\fR'\&.\& The \fIAUTO\fR argument for options is '\&\fByes\fR'\&, '\&\fBno\fR'\& or '\&\fBauto\fR'\&.\& The default value for these arguments is options specific.\& .PP For options with an \fIAUTO\fR or \fIBOOL\fR argument, the argument must be specified with the \fB--option=argument\fR format (that is, the \fB--option argument\fR format is not supported).\& Additionally the following aliases are available: .RS 4 .PD 0 .IP \(bu 4 \fB--option\fR equals \fB--option=yes\fR .IP \(bu 4 \fB--no-option\fR equals \fB--option=no\fR .PD .PP .RE .SH GLOBAL OPTIONS .PP The following options are available for all commands.\& .PP \fB--allow-untrusted\fR .RS 4 Install packages with untrusted signature or no signature.\& .PP .RE \fB--arch\fR \fIARCH\fR .RS 4 Temporarily override architectures.\& The first given \fB--arch\fR will be used as the primary architecture.\& It will be used to determine the paths where to download package indexes from.\& The additional architectures specify compatible packages which are considered for installation.\& .PP When used with --root the architecture will also be saved.\& .PP .RE \fB--cache\fR[=\fIBOOL\fR] .RS 4 When disabled, prevents using any local cache paths.\& .PP .RE \fB--cache-dir\fR \fICACHEDIR\fR .RS 4 Temporarily override the cache directory.\& \fICACHEDIR\fR is treated relative to the \fIROOT\fR.\& .PP .RE \fB--cache-max-age\fR \fIAGE\fR .RS 4 Maximum AGE (in minutes) for index in cache before it'\&s refreshed.\& \fB0\fR means always refresh.\& .PP .RE \fB--cache-packages\fR[=\fIBOOL\fR] .RS 4 Store a copy of packages at installation time to cache.\& Enabled automatically if \fB/etc/apk/cache\fR symlink exists.\& .PP .RE \fB--cache-predownload\fR[=\fIBOOL\fR] .RS 4 Download needed packages to cache before starting to commit a transtaction.\& Requires cache to be configured to be functional.\& Implies \fB--cache-packages\fR.\& .PP .RE \fB--check-certificate\fR[=\fIBOOL\fR] .RS 4 When disabled, omits the validation of the HTTPS server certificate.\& .PP .RE \fB--force\fR, \fB-f\fR .RS 4 Enable selected --force-* options (deprecated).\& .PP .RE \fB--force-binary-stdout\fR .RS 4 Continue even if binary data will be printed to the terminal.\& .PP .RE \fB--force-broken-world\fR .RS 4 DANGEROUS: Delete world constraints until a solution without conflicts is found.\& This does not allow installation of packages with unsatisfiable dependencies and is mainly intended to be used initramfs boot and is implied by \fB--initramfs-diskless-boot\fR.\& The primary purpose is to allow run-from-tmpfs systems to boot if media was upgraded and some packages are no longer available in the new release.\& .PP APK will try to determine the world constraints that causes packages with conflicting dependencies and start disabling the world constraints in this order until a satisfiable set of constraints is left.\& Using this switch on hard disk installation will likely result in unexpected removal of some packages.\& If uncertain, use with \fB--interactive\fR or \fB--simulate\fR first.\& .PP .RE \fB--force-missing-repositories\fR .RS 4 Continue even if some of the repository indexes are not available.\& .PP .RE \fB--force-no-chroot\fR .RS 4 Disable chroot for scripts.\& This can be used for rootfs creation when chroot is not available.\& Scripts running outside a chroot environment may modify and damage the host system.\& .PP .RE \fB--force-non-repository\fR .RS 4 Continue even if packages may be lost on reboot.\& This can happen when running in run-from-tmpfs mode, and installing non-repository package.\& .PP .RE \fB--force-old-apk\fR .RS 4 Continue even if packages use unsupported features.\& .PP .RE \fB--force-overwrite\fR .RS 4 Overwrite files in other packages.\& .PP .RE \fB--force-refresh\fR .RS 4 Do not use cached files (local or from proxy).\& .PP .RE \fB--help\fR, \fB-h\fR .RS 4 Print the list of all commands with descriptions.\& .PP .RE \fB--interactive\fR[=\fIAUTO\fR] .RS 4 Determine if questions can be asked before performing certain operations.\& In \fBauto\fR mode, the interactive mode is enabled if running on a tty.\& Defaults to \fBno\fR, or \fBauto\fR if \fB/etc/apk/interactive\fR exists.\& .PP .RE \fB--keys-dir\fR \fIKEYSDIR\fR .RS 4 Override the default system trusted keys directories.\& If specified the only this directory is processed.\& The \fIKEYSDIR\fR is treated relative to \fIROOT\fR.\& .PP .RE \fB--legacy-info\fR[=\fIBOOL\fR] .RS 4 Print output from "info" applet in legacy format or new "query" format.\& Defaults to no currently, but the default is subject to change to yes in a future release.\& .PP .RE \fB--logfile\fR[=\fIBOOL\fR] .RS 4 If turned off, disables the writing of the log file.\& .PP .RE \fB--network\fR[=\fIBOOL\fR] .RS 4 If turned off, does not use the network.\& The packages from network repositories in the cache are used.\& .PP .RE \fB--preserve-env\fR[=\fIBOOL\fR] .RS 4 Allow passing the user environment down to scripts (excluding variables starting APK_ which are reserved).\& .PP .RE \fB--pretty-print\fR[=\fIAUTO\fR] .RS 4 Determine if output should be stylized to be human readable.\& Defaults to \fBauto\fR which resolves to \fByes\fR if running on a tty.\& .PP .RE \fB--preupgrade-depends\fR \fIDEPS\fR .RS 4 Add or modify preupgrade dependencies.\& The preupgrade dependencies are used to match installed packages that are eligible for preupgrade.\& E.\&g.\& '\&apk-tools'\& will always preupgrade the '\&apk-tools'\& package, but '\&baselayout<2'\& would preupgrade the '\&baselayout'\& only if the installed version of baselayout is less than 2 and an upgrade is available.\& See also \fBapk-upgrade\fR(8).\& .PP .RE \fB--print-arch\fR .RS 4 Print default arch and exit.\& .PP .RE \fB--progress\fR[=\fIAUTO\fR] .RS 4 Enable or disable progress bar.\& Defaults to \fBauto\fR which resolves to \fByes\fR if running on a tty.\& .PP .RE \fB--progress-fd\fR \fIFD\fR .RS 4 Write progress to the specified file descriptor.\& .PP .RE \fB--purge\fR[=\fIBOOL\fR] .RS 4 Purge modified configuration and cached packages.\& Enables deletion of modified configuration files on package removal.\& On cache clean action this enables deletion of unneeded cached packages (uninstalled packages on tmpfs installations or all packages on disk installations).\& .PP .RE \fB--quiet\fR, \fB-q\fR .RS 4 Print less information.\& .PP .RE \fB--repositories-file\fR \fIREPOFILE\fR .RS 4 Override system repositories, see \fBapk-repositories\fR(5).\& Specifying this option overrides the normal repositories file and repositories.\&d directory processing.\& The given \fIREPOFILE\fR is relative to the startup directory since apk 2.\&12.\&0_rc2.\& .PP .RE \fB--repository\fR, \fB-X\fR \fIREPO\fR .RS 4 Specify additional package repository.\& \fBapk-repositories\fR(5) specified commands are not parsed (use \fB--repository-config\fR for that).\& Additionally, relative paths are accepted and interpreted relative to the startup directory.\& .PP .RE \fB--repository-config\fR \fIREPOCONFIG\fR .RS 4 Specify additional package repository configuration.\& The \fIREPOCONFIG\fR is parsed exactly the same way as if it was read from a \fBapk-repositories\fR(5) specified \fB.\&list\fR file.\& .PP .RE \fB--root\fR, \fB-p\fR \fIROOT\fR .RS 4 Manage file system at \fIROOT\fR.\& .PP .RE \fB--root-tmpfs\fR[=\fIAUTO\fR] .RS 4 Specify if the \fIROOT\fR is a temporary filesystem.\& Defaults to \fBauto\fR which determines the filesystem type automatically.\& .PP This affects: .RS 4 .PD 0 .IP \(bu 4 reading and creation of '\&installed'\& index in the cache .IP \(bu 4 purging of packages in cache .IP \(bu 4 safety checks to not install non-repository packages .PD .PP .RE .RE \fB--sync\fR[=\fIAUTO\fR] .RS 4 Determine if filesystem caches should be committed to disk.\& Defaults to \fBauto\fR which resolves to \fByes\fR if \fB--root\fR is not specified, the database is not in usermode, and running on the root pid namespace (not containerized).\& .PP .RE \fB--timeout\fR \fITIME\fR .RS 4 Timeout network connections if no progress is made in TIME seconds.\& The default is 60 seconds.\& .PP .RE \fB--update-cache\fR, \fB-U\fR .RS 4 Alias for '\&--cache-max-age 0'\&.\& .PP .RE \fB--uvol-manager\fR \fIUVOL\fR .RS 4 Specify the OpenWRT \fIuvol\fR volume manager executable location.\& .PP .RE \fB--verbose\fR, \fB-v\fR .RS 4 Print more information (can be specified twice).\& .PP .RE \fB--version\fR, \fB-V\fR .RS 4 Print program version and exit.\& .PP .RE \fB--wait\fR \fITIME\fR .RS 4 Wait for TIME seconds to get an exclusive repository lock before failing.\& .PP .RE .SH COMMIT OPTIONS .PP The following options are available for all commands which commit the database.\& .PP \fB--clean-protected\fR[=\fIBOOL\fR] .RS 4 If disabled, prevents creation of .\&apk-new files in configuration directories.\& .PP .RE \fB--commit-hooks\fR[=\fIBOOL\fR] .RS 4 If disabled, skips the pre/post hook scripts (but not other scripts).\& .PP .RE \fB--initramfs-diskless-boot\fR .RS 4 Used by initramfs when it'\&s recreating root tmpfs.\& This enables selected force options to minimize failure, and disables commit hooks, among other features.\& .PP .RE \fB--overlay-from-stdin\fR .RS 4 Read list of overlay files from stdin.\& Normally this is used only during initramfs when booting run-from-tmpfs installation.\& .PP .RE \fB--scripts\fR[=\fIBOOL\fR] .RS 4 If disabled, prevents execution of all scripts.\& Useful for extracting a system image for different architecture on alternative \fIROOT\fR.\& .PP .RE \fB--simulate\fR[=\fIBOOL\fR], \fB-s\fR .RS 4 Simulate the requested operation without making any changes.\& The database is opened in read only mode, and auto-updating of indexes is disabled.\& You may want to run "apk update" before running a simulation to make sure it is done with up-to-date repository indexes.\& .PP .RE .SH GENERATION OPTIONS .PP The following options are available for all commands which generate APKv3 files.\& .PP \fB--compression, -C\fR \fIALGORITHM[:LEVEL]\fR .RS 4 Compress the file with given \fIALGORITHM\fR and \fILEVEL\fR.\& Supported algorithms: .PD 0 .IP \(bu 4 none .IP \(bu 4 deflate (level 1-9) .IP \(bu 4 zstd (level 1-22) .PD .PP .RE \fB--sign-key\fR \fIKEYFILE\fR .RS 4 Sign the file with a private key in the specified \fIKEYFILE\fR.\& .PP .RE .SH ENVIRONMENT .PP \fBAPK_CONFIG\fR .RS 4 Override the default config file name.\& See \fB/etc/apk/config\fR .PP .RE \fBLANG\fR .RS 4 Used to determine if UTF-8 is supported, and set the default progress character accordingly.\& .PP .RE \fBSOURCE_DATE_EPOCH\fR .RS 4 See \fBapk-index\fR(8).\& .PP .RE \fBTERM\fR .RS 4 Used to determine if the terminal is dumb or not.\& Progress bar is not enabled on dumb terminals by default.\& .PP .RE .SS Variables to configure built-in libfetch .PP \fBFETCH_BIND_ADDRESS\fR .RS 4 A local IP address to which libfetch will bind all sockets it creates.\& Can be useful for source routing.\& .PP .RE \fBNETRC\fR .RS 4 Specify the \fB.\&netrc\fR file to read for authentication secrets.\& If not set, defaults to \fB$HOME/.\&netrc\fR.\& .PP .RE \fBHTTP_AUTH\fR .br \fBHTTP_REFERER\fR .br \fBHTTP_USER_AGENT\fR .RS 4 Specify a custom HTTP level \fBAuthorization\fR, \fBReferer\fR or \fBUser-Agent\fR header.\& .PP .RE \fBHTTP_PROXY\fR, \fBhttp_proxy\fR .br \fBHTTPS_PROXY\fR, \fBhttps_proxy\fR .br If set, these variables should contain the proxy URL for \fBhttp\fR .RS 4 and \fBhttps\fR connections respectively.\& .PP .RE \fBHTTP_PROXY_AUTH\fR .RS 4 Specify a HTTP \fBProxy-Authorization\fR header.\& Used only if the connection is established through a configured HTTP proxy.\& .PP .RE \fBNO_PROXY\fR, \fBno_proxy\fR .RS 4 Comma-separated list of domain extensions or CIDR notation IP addresses to which a proxy should \fInot\fR be used for.\& This is used explicitly to test the URL hostname portion only.\& That is, specifying an IP address or CIDR block will not match a DNS name that resolves to the IP address.\& .PP .RE \fBSSL_CLIENT_CERT_FILE\fR .br \fBSSL_CLIENT_KEY_FILE\fR .RS 4 Override default SSL client certificate and corresponding private key filename.\& .PP .RE \fBSSL_NO_VERIFY_HOSTNAME\fR .RS 4 If set to anything, disables the server certificate name verification.\& .PP .RE .SS Environment for the scripts APK executes .PP Normally \fBapk\fR will execute scripts with a sanitized, minimal environment containing only \fBPATH\fR.\& See also \fB--preserve-env\fR to pass additional environment variables.\& .PP Before executing a script, apk will set working directory as \fIROOT\fR and performs a chroot unless \fB--force-no-chroot\fR is specified.\& In either case, the script working directory should be treated as the system root.\& .PP The environment variables defined by APK are the following: .PP \fBAPK_PACKAGE\fR .RS 4 Package name (package scripts only).\& .PP .RE \fBAPK_SCRIPT\fR .RS 4 Set to one of the package or commit script types.\& Use this to determine the script hook type if needed.\& The filename ($0) is not reliable since apk prefers to execute package scripts from a memfd file.\& .PP .RE .SH FILES .PP .SS Configuration files .PP \fB/etc/apk/config\fR .br \fB/lib/apk/config\fR .RS 4 Default global options.\& Only the first file existing in the above list is read and parsed.\& The file in \fB/lib\fR is intended to be for distribution default options, which can be then overridden by user with the file in \fB/etc\fR.\& See also \fBAPK_CONFIG\fR environment variable.\& .PP A configuration file contains one long option per line.\& For example: .RS 4 no-cache .br timeout 120 .PP .RE .RE \fB/etc/apk/interactive\fR .RS 4 If this file exists it defaults \fB--interactive\fR to \fBauto\fR.\& .PP .RE .SS Configuration files (relative to --root) .PP \fB/etc/apk/arch\fR .RS 4 The CPU architecture for this database.\& See \fBapk-package\fR(5) section on package metadata field \fBarch\fR for the list.\& .PP .RE \fB/etc/apk/cache\fR .RS 4 This is expected to be a symlink to directory what apk will use as package cache.\& See also \fBapk-cache\fR(5) and \fBapk-cache\fR(8).\& .PP .RE \fB/etc/apk/commit_hooks.\&d/*\fR .br \fB/lib/apk/commit_hooks.\&d/*\fR .RS 4 Hook scripts which are executed before anything has been written to the filesystem and after all the changes have been commited.\& The script executed gets as an argument the stage name (\fBpre-commit\fR or \fBpost-commit\fR).\& If the script returns failure during \fBpre-commit\fR stage, the commit is aborted.\& .PP See also the ENVIRONMENT section for the environment variables.\& .PP If \fB--no-scripts\fR or \fB--no-commit-hooks\fR option is specified, these hook scripts are not executed.\& .PP .RE \fB/etc/apk/keys\fR .br \fB/lib/apk/keys\fR .RS 4 Directories for trusted signing keys.\& The directories are enumerated in the above mentioned order.\& Once a given filename is seen, any file of the same name in subsequent directories is ignored.\& .PP .RE \fB/etc/apk/protected_paths.\&d/*.\&list\fR .RS 4 Configuration files to specify how to treat changes to specified directory or file masks.\& The file format is further documented in \fBapk-protected_paths\fR(5).\& .PP .RE \fB/etc/apk/repositories\fR .br \fB/etc/apk/repositories.\&d/*.\&list\fR .br \fB/lib/apk/repositories.\&d/*.\&list\fR .RS 4 Configuration files to specify repositories.\& The directories are enumerated in the above mentioned order.\& Once a given filename is seen, any file of the same name in subsequent directories is ignored.\& See \fBapk-repositories\fR(5) for details.\& .PP .RE \fB/etc/apk/world\fR .RS 4 Top level requirements and constraints on what should be installed.\& See \fBapk-world\fR(5) for details.\& .PP .RE .SS Configuration files for built-in libfetch .PP \fB/etc/apk/ca.\&pem\fR .RS 4 CA certificate store bundle for verifying server certificates.\& If not present, the default system CA store is used.\& .PP .RE \fB/etc/apk/crl.\&pem\fR .RS 4 CRL store to check the server certificates against.\& .PP .RE \fB/etc/apk/cert.\&key\fR .RS 4 Client certificate private key.\& .PP .RE \fB/etc/apk/cert.\&pem\fR .RS 4 Client certificate to use for authentication.\& .PP .RE .SS System files .PP \fB/lib/apk/db/lock\fR .RS 4 A lock file used to allow only one concurrent write transaction on the system.\& .PP .RE \fB/lib/apk/db/installed\fR .RS 4 Database of installed packages and their contents.\& .PP .RE \fB/lib/apk/db/scripts.\&tar\fR .br \fB/lib/apk/db/scripts.\&tar.\&gz\fR .RS 4 Collection of all package scripts from currently installed packages.\& .PP .RE \fB/lib/apk/db/triggers\fR .RS 4 List of triggers rules for currently installed packages.\& .PP .RE \fB/lib/apk/db-uvol\fR .RS 4 Database symlink or a directory with similar structure as \fB/lib/apk/db/\fR, but which used for package content when managed using OpenWRT \fBuvol\fR volume manager.\& .PP .RE \fB/lib/apk/exec\fR .RS 4 Temporary directory for extraction and execution of package scripts and triggers.\& .PP .RE \fB/var/log/apk.\&log\fR .RS 4 Log file for changes done to the system.\& .PP .RE .SH NOTES .PP This apk has coffee making abilities.\&