AlpineQuickNotes - henk52/knowledgesharing GitHub Wiki

Alpine Linux Quick Notes

Installation

Adding Edge repo

See: https://wiki.alpinelinux.org/wiki/Edge

Running scap in an Alpine docker image

You need at least Alpine 3.10 to install openscap.

Getting an XML file See: https://nvd.nist.gov/ncp/checklist/769/download/2284

  1. http://dl-cdn.alpinelinux.org/alpine/v3.10/main
  2. vi /etc/apk/repositories
  3. wget https://github.com/OpenSCAP/scap-security-guide/releases/download/v0.1.33/scap-security-guide-0.1.33.zip
  4. unzip scap-security-guide-0.1.33.zip
  5. oscap oval eval --results tst.xml scap-security-guide-0.1.33/ssg-centos7-ds.xml
http://dl-cdn.alpinelinux.org/alpine/v3.10/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
http://dl-cdn.alpinelinux.org/alpine/edge/testing

Building

multicast

Building mrouted

  1. wget https://github.com/troglobit/mrouted/releases/download/4.0/mrouted-4.0.tar.gz
  2. wget https://github.com/troglobit/mrouted/releases/download/4.0/mrouted-4.0.tar.gz.md5
  3. https://github.com/troglobit/mrouted/releases/download/4.0/mrouted-4.0.tar.gz.md5
  4. tar -xf mrouted-4.0.tar.gz
  5. cd mrouted-4.0
  6. ./configure --prefix=/usr
  7. make -j5

Building mcjoin

  1. get the tar
  2. docker run -it alpine sh
  3. docker cp mcjoin-2.6.tar.xz pedantic_saha:/artifacts
  4. in docker
  5. apk add g++
  6. tar -xf mcjoin-2.6.tar.xz
  7. cd mcjoin-2.6
  8. ./configure --prefix=/usr
  9. make -j5
  10. outside:
  11. docker cp pedantic_saha:/artifacts/mcjoin-2.6/src/mcjoin .

Installation

package management

See: https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management

  • apk fetch

Installing alpine in a VM

See: https://wiki.alpinelinux.org/wiki/Installation

  1. Boot from cd-rom
  2. login as root
  3. run: setup-alpine
  • disk:
  • sda
  • sys

Installing a router

  1. apk add vlan
  1. modprobe 8021q

Troubleshooting

Troubleshooting pkg installation

ERROR: http://dl-cdn.alpinelinux.org/alpine/edge/testing: UNTRUSTED signature

Fix: apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.16/main -u alpine-keys

See:

Step 3/5 : RUN apk add wabt --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
 ---> Running in 7a5391f77a55
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/edge/testing: UNTRUSTED signature
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
ERROR: unable to select packages:
  wabt (no such package):
    required by: world[wabt]
The command '/bin/sh -c apk add wabt --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing' returned a non-zero code: 1
make: *** [Makefile:2: all] Error 1

Troubleshooting networking

Troubleshooting networking interfaces

nic does not come up after running service networking restart

It turns out there has to be an 'auto INTERFACE' in the /etc/networking/interfaces e.g. auto eth1

OpenScap

scap-docker

Compiling

configure: error: C compiler cannot create executables

apk add g++

See: https://unix.stackexchange.com/questions/367465/c-compiler-cannot-create-executables-when-installing-gcc-and-binutils

mjoin

No interface (eth0), or no IPv6 address yet, rc 0: Interrupted system call