How to get regular stuff working

From Alpine Linux
Revision as of 02:05, 12 April 2026 by Apropos (talk | contribs) (→‎Search utilities: clean up wording and mention ripgrep. deciding not to mention fd (find alternative) as ripgrep is much more widely used)

Alpine Linux is built around musl libc and BusyBox and software packages are thinned out and split into subpackages. This makes it small and very resource efficient. The utilities in BusyBox tend to only implement standard options and lack GNU-specific extensions. This page explains how to get the utilities typically found in GNU/Linux distributions.

Many utilities on this page are provided either by a package containing multiple collected utilities, or through a meta package. The apk info command and its various flags (--provides, --depends, --who-owns, etc) is useful for determining exactly what is provided by what.

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 GNU coreutils package:

# apk add coreutils

Linux utilities

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

The standard search tools find and xargs are provided by the findutils package:

# apk add findutils

GNU Grep is available as the grep package. The ripgrep package is also available and provides rg.

Shell management

The default shell used by Alpine Linux is the Busybox variant of the ash shell. This is a POSIX compliant shell. All popular shells are available in Alpine Linux and the default shell can be changed, if desired.

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 disks including 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

Locale and key management

  • Locales, including keyboards, languages and date and time formats are typically configured with the setup-alpine and like scripts, and within desktop environment settings.
  • Consult the Compose Key wikipage to create foreign currency symbols, accents and diacritics, endashes (–) and emdashes (—), etc.

Subpackages and missing functionality

When a package is installed in Alpine Linux, no assumption is made as to what features the user wants, so subpackages are not installed by default. As such, the user might get a false impression of missing functionality.

For example, the networkmanager package for NetworkManager has 20+ subpackages based on features. If the user installs the networkmanager package, only the NetworkManager utility will get installed. To manage Wi-Fi networks, use commands like nmcli and nmtui, or launch the GTK applet, the user is expected to add the required subpackages networkmanager-wifi, networkmanager-cli, networkmanager-tui, and network-manager-applet respectively.

This is in contrast to many other Linux distributions, where when NetworkManager is installed all the above functionality plus that of networkmanager-bluetooth, networkmanager-adsl, networkmanager-wwan, networkmanager-openvpn, networkmanager-l2tp, networkmanager-ppp, and the like are automatically installed, along with their dependencies.

Development environment

Compiling in Alpine Linux may be more challenging because it uses musl 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.