...
Action | apt command | apk command |
---|---|---|
Update package database | apt-get update | apk update |
Install packages | apt-get install package1 package2 | apk add package1 package2 |
Remove packages | apt-get remove package1 package2 | apk del package1 package2 |
Download packages | apt-get install --download-only package1 package2 | apk fetch package1 package2 |
Clean up downloaded packages | apt-get clean | Alpine cleans up packages automatically. |
Running apk
To further explore apk, spin a Docker container, attach to it and explore apk
$ docker pull alpine
$ docker run -ti alpine
You will get Alpine's shell prompt. To get detailed information on options and sub-commands, execute:
#apk --help --verbose