Linux – How to install .apk on Alpine Linux like .deb in Debian using dpkg

installationlinux

My question is in the title. Problem:

Comparison with other distros doesn't speak about installing a local .deb in Debian or whatever is Gentoo's equivalent or Alpine Linux's .apk. Plus the command apk add complains about unsatisfiable dependencies for the world when I want it to install from .apk file downloaded, and it doesn't tell what's wrong, just:

world: <package_name> <package_name>

Simple more-or-less obvious searches such as how to install apk on alpine linux returns something weird or Android stuff, making Alpine Linux look like it doesn't exist in the first place -or- doesn't support installing a downloaded package like you can do in Debian with dpkg.

Best Answer

Let's say you are trying to install glibc in Alpine

Download the packages into your current directory

wget "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk"
wget "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk"

Then, use apk with --allow-untrusted flag

apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk

And finish the installation (only needed in this example)

/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib
Related Question