How to get regular stuff working

From Alpine Linux

Alpine Linux is built around Musl libc and BusyBox. This makes it small and very resource efficient. The utilities in BusyBox generally have fewer options and hence missing some extended functionality. This page explains how to get the regular utilities working as found in GNU/Linux distributions.

Core utilities

Most of the basic file, shell and text manipulation utilities commonly grouped under Core Utilities are provided by BusyBox. To replace it with original coreutils package:

# apk add coreutils

Util-linux

A set of approximately 100 basic Linux system utilities not included in GNU Core Utilities, such as mount, cfdisk, more, lsblk and kill are maintained under Util-linux. The util-linux package is split into multiple subpackages, so it is possible to install only some of them individually. To have the complete util-linux package:

# apk add util-linux

The full featured file pager utility less can be installed from the less package.

Search utilities

Standard search tools grep and find can be installed by installing the packages grep and findutils as follows:

# apk add grep findutils

Bash shell

The default shell used by Alpine Linux is the busybox variant of the ash shell. To install bash shell:

# apk add bash bash-completion

Hardware Management

Install pciutils and usbutils for identifying and configuring PCI and USB hardware using the full featured version of lspci and lsusb commands respectively.

# apk add pciutils usbutils

The packages hwdata-pci and hwdata-usb are dependencies for the above utilities and they are installed automatically. These packages can be removed once the hardware configuration has been completed.

Disk Management

Managing (removable) disks is much easier with udisks.

# apk add udisks2

To see the mounted disks:

# udisksctl status

Network Management

For network, you may want to install iproute2.

# apk add iproute2

Subpackages and missing functionality

When a package is installed in Alpine Linux, no assumption is made on what features the user wants, so subpackages are not installed by default. The user might get a false impression of missing functionality. Alpine Linux package database page shows the list of available subpackages.

For eg: NetworkManager, a popular network configuration tool is split into 20+ subpackages based on features. If the user installs networkmanager package or network-manager-applet only the NetworkManager utility and the applet will get installed. To manage Wifi networks or to use commands like nmcli and nmtui the user is expected to add the required subpackages networkmanager-wifi, networkmanager-cli and networkmanager-tui respectively.

In other Linux distributions when NetworkManager is installed, all the above features plus bluetooth, adsl, wwan, vpn, l2tp, ppp etc are automatically installed along with their dependencies.

Development environment

Compiling in Alpine Linux may be more challenging because it uses musl-libc instead of glibc. The build-base meta package provides regular compiler stuff such as binutils, gcc, g++, make etc..

# apk add build-base

The alpine-sdk meta package is provided to build packages for Alpine Linux. It includes abuild, build-base, and git.

# apk add alpine-sdk

To install CMake:

# apk add cmake extra-cmake-modules

ccache and a lot other tools are also available in Alpine Linux.