How to get regular stuff working: Difference between revisions

From Alpine Linux
m (Fix spelling and repeated information)
m (added note on POSIX)
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Alpine comes with busybox by default. Busybox is set up as an endpoint for numerous symlinks that substitute various utilities. Since busybox tries to be a minimalistic package, the busybox commands may still be missing some functionality.  
Alpine Linux is built around [[Musl]] libc and [[BusyBox]]. 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.


To replace the busybox symlinks, you can install the relevant packages:
== Core utilities ==
{{Main|GNU core utilities}}


== Basic utilities ==
Most of the basic file, shell and text manipulation utilities commonly grouped under [https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands Core Utilities] are provided by [[BusyBox]]. To replace it with original {{pkg|coreutils}} package:{{Cmd|# apk add {{pkg|coreutils}}}}
Very basic utilities ranging from cd, ls, lsblk, grep, are all busybox symlinks by default. To have the complete packages:


{{Cmd|# apk add {{pkg|util-linux}} {{pkg|coreutils}} {{pkg|grep}} {{pkg|findutils}} }}
== Util-linux ==


== Bash shell ==
A set of approximately 100 basic Linux system utilities not included in GNU Core Utilities, such as <code>mount</code>, <code>cfdisk</code>, <code>more</code>, <code>lsblk</code> and <code>kill</code> are maintained under [https://en.wikipedia.org/wiki/Util-linux Util-linux]. The {{pkg|util-linux}} package is split into multiple subpackages, so it is possible to install only some of them individually. To have the complete {{pkg|util-linux}} package:{{Cmd|# apk add {{pkg|util-linux}}}}


It's also easy enough to install bash itself, or any other shell of your choice: 
The full featured file pager utility <code>less</code> can be installed from the {{pkg|less}} package.


{{Cmd|apk add {{pkg|bash}} {{pkg|bash-completion}}}}
== Search utilities  ==


and optionally, change the login shell with '''{{ic|chsh}}'''.
Standard search tools <code>xargs</code> and <code>find</code> can be installed by via the {{pkg|findutils}} package as follows:{{Cmd|# apk add {{pkg|findutils}} }}


== Hardware Management ==
GNU Grep is also available as the {{pkg|grep}} package.


Install {{pkg|pciutils}} and {{pkg|usbutils}} for configuring PCI and USB hardware respectively. You can always remove these packages once the hardware is configured.  
== Shell management ==
{{Main|Shell management}}
The default shell used by Alpine Linux is the Busybox variant of the [[Shell_management#Ash_shell|ash shell]]. This is a POSIX compliant shell. All popular shells are available in Alpine Linux and the [[Shell_management#Change_default_shell|default shell can be changed]], if desired.


{{Cmd|# apk add {{pkg|pciutils}} {{pkg|usbutils}}}}
== Hardware management ==


The packages {{pkg|hwdata-pci}} and {{pkg|hwdata-usb}} are dependencies for the above utilities and they are installed automatically.
Install {{pkg|pciutils}} and {{pkg|usbutils}} for identifying and configuring PCI and USB hardware using the full featured version of <code>lspci</code> and <code>lsusb</code> commands respectively. {{Cmd|# apk add {{pkg|pciutils}} {{pkg|usbutils}}}}


== Disk Management ==
The packages {{pkg|hwdata-pci}} and {{pkg|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.


Managing (removable) disks is much easier with udisks.
== Disk management ==
{{Main|File management}}
Managing disks including removable disks is much easier with udisks.{{Cmd|# apk add {{pkg|udisks2}}}} To see the mounted disks:{{Cmd|# udisksctl status}}


{{Cmd|# apk add {{pkg|udisks2}}}}
== Network management ==
{{Main|Configure Networking}}
For network, you may want to install {{pkg|iproute2}}. {{Cmd|# apk add {{pkg|iproute2}}}}  


To see the mounted disks:
== Subpackages and missing functionality  ==


{{Cmd|# udisksctl status}}
When a package is installed in Alpine Linux, no assumption is made on what features the user wants, so [[Alpine_Package_Keeper#Subpackages|subpackages]] are not installed by default. The user might get a false impression of missing functionality. Alpine Linux [https://pkgs.alpinelinux.org package database] page shows the list of available subpackages.


== Network Management ==
For eg: [[NetworkManager]], the standard network configuration tool is split into 20+ subpackages based on features. If the user installs {{pkg|networkmanager}} package or {{pkg|network-manager-applet}} only the NetworkManager utility and the applet will get installed. To manage Wifi networks or to use commands like <Code>nmcli</Code> and <Code>nmtui</Code> the user is expected to add the required subpackages {{pkg|networkmanager-wifi}}, {{pkg|networkmanager-cli}} and {{pkg|networkmanager-tui}} respectively.  
For network, you may want to install {{pkg|iproute2}}.


{{Cmd|# apk add {{pkg|iproute2}}}}
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 ==
== Development environment ==
{{Main|Developer_Documentation}}
Compiling in Alpine Linux may be more challenging because it uses [Musl] instead of glibc. The {{pkg|build-base}} meta package provides regular compiler stuff such as {{pkg|binutils}}, {{pkg|gcc}}, {{pkg|g++}}, {{pkg|make}} etc..


Compiling in Alpine may be more challenging because it uses [https://musl.libc.org/ musl-libc] instead of glibc.  Alpine offers the regular compiler stuff such as {{pkg|gcc}}.
{{Cmd|# apk add {{pkg|build-base}}}}


{{Cmd|# apk add {{pkg|gcc}}}}
The {{pkg|alpine-sdk}} meta package is provided to build packages for Alpine Linux. It includes {{pkg|abuild}}, {{pkg|build-base}}, and {{pkg|git}}.
 
The {{pkg|alpine-sdk}} meta package is provided to build packages for Alpine. It includes {{pkg|abuild}}, {{pkg|build-base}}, and {{pkg|git}}.


{{Cmd|# apk add {{pkg|alpine-sdk}}}}
{{Cmd|# apk add {{pkg|alpine-sdk}}}}
Line 53: Line 58:
{{Cmd|# apk add {{pkg|cmake}} {{pkg|extra-cmake-modules}}}}
{{Cmd|# apk add {{pkg|cmake}} {{pkg|extra-cmake-modules}}}}


{{pkg|ccache}} and a lot other tools are also available in Alpine.  
{{pkg|ccache}} and a lot other tools are also available in Alpine Linux.  


[https://wiki.musl-libc.org/functional-differences-from-glibc.html Functional differences between musl and glibc]
[[Category:Installation]]
[[Category:Installation]]
[[category: System Administration]]

Latest revision as of 04:58, 20 July 2025

Alpine Linux is built around Musl libc and BusyBox. 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.

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 xargs and find can be installed by via the findutils package as follows:

# apk add findutils

GNU Grep is also available as the grep package.

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

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, the standard 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] 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.