Linux – Install apk tool on Alpine Linux

alpine-linuxapk-tools

I'm fiddling with a Docker image, built from a Virtualbox VM using Packer. The image is Alpine Linux 5.3.0, but apk seems to have been removed.

How can I reinstall apk, or build it from source? Googling seems only to yield results on people installing packages, or Android apps!

Best Answer

Probably you mean v3.5.0.

The easier way is (if your architecture is x86_64):

wget http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/apk-tools-static-2.6.8-r1.apk

And then unpack the downloaded file:

tar -zxvf apk-tools-static-2.6.8-r1.apk

You'll find in the unpacked apk the apk.static file, that you can use to install apk-tools.

More info here: https://wiki.alpinelinux.org/wiki/Upgrading_Alpine

Of course, if your architecture is x86, the url is:

wget http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86/apk-tools-static-2.6.8-r1.apk

Anyway, the package you need is "apk-tools".

Related Question