14

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.

3 Answers 3

14

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
1
  • how do I open the archive? Sep 15, 2021 at 13:56
0

Generally, prebuilt packages are preferrable, but if you want or don't mind building from source, you can do it this way:

a.sh:

apk add alpine-sdk sudo
abuild-keygen -ain
git clone --branch v3.15.4 --single-branch --depth 1 https://gitlab.alpinelinux.org/alpine/aports
cd aports/main/musl
abuild -rF
apk add /root/packages/main/x86_64/musl-1.2.2-r7.apk
$ docker run --rm -itv $PWD:/host alpine:3.15 sh -eux host/a.sh

If you're doing it on the host OS, you generally don't want to build under root. In which case you don't need to pass -F to abuild.

For further details you can refer to this page.

-2

Look at the AlpineLinux Wiki page on Alpine Linux package management?

Verbatim from there,

Because Alpine Linux is designed to run from RAM, package management involves two phases:

  1. Installing / Upgrading / Deleting packages on a running system
  2. Restoring a system to a previously configured state (e.g. after reboot), including all previously installed packages and locally modified configuration files. (RAM-Based Installs Only)

apk is the tool used to install, upgrade, or delete software on a running sytem.
lbu is the tool used to capture the data necessary to restore a system to a previously configured state.

This page documents the apk tool - See the Alpine Local Backup page for the lbu tool.

1
  • 1
    This does not answer the question.
    – gdw2
    Jun 20, 2015 at 2:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .