Size: 979
Comment:
|
← Revision 5 as of 2023-05-30 14:29:02 ⇥
Size: 1468
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 32: | Line 32: |
`apk(1)` accesses packages from a list of mirrors located at `/etc/apk/repositories`. Note that the '''community''' mirror is commented-out by default. Uncomment that line to install software such as [[Docker]]. | |
Line 34: | Line 33: |
When adding a custom mirror, know that `apk(1)` checks package signatures against those stored in `/etc/apk/keys/`. Copy unofficial packagers' keys here to satisfy the integrity checks. | === Repositories === A respository is enabled or disabled simply by adding/deleting/(un)commenting a line in `etc/apk/repositories`. For example, a `community` repository is typically listed but commented out by default. To enable it, uncomment the line. For custom repositories, '''prepend''' the corresponding URI to the file. It is important to ''prepend'' rather than ''append'', as `apk(1)` scans repositories in order and some packages may be shadowed for the additional software. {{{ cat - /etc/apk/repositories <<<"$repouri" >/etc/apk/repositories }}} === Signing Keys === Packages are signed by default, and `apk(1)` checks signatures against the keys installed in `/etc/apk/keys/`. Custom repositories typically have the public key available in the root directory. {{{ wget --quiet --output-document=/etc/apk/keys/$keyfile $keyuri/$keyfile }}} |
APK
apk(8) (Alpine Package Keeper) is the package manager for Alpine Linux. It is specially designed to manage packages on a system that itself is designed to run in memory.
Contents
Usage
To update local metadata and upgrade installed packages, try:
apk update apk upgrade
To install a package, try:
apk add docker
Configuration
Repositories
A respository is enabled or disabled simply by adding/deleting/(un)commenting a line in etc/apk/repositories.
For example, a community repository is typically listed but commented out by default. To enable it, uncomment the line.
For custom repositories, prepend the corresponding URI to the file. It is important to prepend rather than append, as apk(1) scans repositories in order and some packages may be shadowed for the additional software.
cat - /etc/apk/repositories <<<"$repouri" >/etc/apk/repositories
Signing Keys
Packages are signed by default, and apk(1) checks signatures against the keys installed in /etc/apk/keys/.
Custom repositories typically have the public key available in the root directory.
wget --quiet --output-document=/etc/apk/keys/$keyfile $keyuri/$keyfile