How to get regular stuff working: Difference between revisions

From Alpine Linux
m (added link to GNU core utilities)
(added headings .. rephrased sentences .. added more information. links)
 
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.  
To minimize the footprint Alpine Linux comes with [[BusyBox]] and it is set up as an endpoint for numerous symlinks that substitute various utilities. The utilities in BusyBox generally have fewer options and hence missing some functionality. This page explains how to get the regular utilities working as found in other Linux distributions. To replace the busybox symlinks, one needs to install the relevant packages.


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:
{{Main|GNU core utilities}}
 
Very basic utilities ranging from cd, ls, lsblk, grep, are all busybox symlinks by default. To have the complete packages:
{{Cmd|# apk add {{pkg|coreutils}}}}
 
== Util-linux  ==
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]. To have the complete {{pkg|util-linux}} package:
{{Cmd|# apk add {{pkg|util-linux}}}}


{{Cmd|# apk add {{pkg|util-linux}} {{pkg|coreutils}} {{pkg|grep}} {{pkg|findutils}} }}
== Search utilities  ==
Standard search tools <code>grep</code> and <code>find</code> can be installed by installing the packages {{pkg|grep}} and {{pkg|findutils}} as follows:
{{Cmd|# apk add  {{pkg|grep}} {{pkg|findutils}} }}


== Bash shell ==  
== Bash shell ==  
{{Main|Change default shell}}
{{Main|Change default shell}}
The default shell used by Alpine Linux is the busybox variant of the [https://en.wikipedia.org/wiki/Almquist_shell ash] shell. To install bash:
The default shell used by Alpine Linux is the busybox variant of the [[BusyBox#Ash_shell|ash shell]]. To install {{pkg|bash}}:
{{Cmd|# apk add {{pkg|bash}} {{pkg|bash-completion}}}}
{{Cmd|# apk add {{pkg|bash}} {{pkg|bash-completion}}}}


== Hardware Management ==
== Hardware Management ==
Install {{pkg|pciutils}} and {{pkg|usbutils}} for configuring PCI and USB hardware respectively. You can always remove these packages once the hardware is configured.  
Install {{pkg|pciutils}} and {{pkg|usbutils}} for configuring PCI and USB hardware respectively. You can always remove these packages once the hardware is configured.  



Latest revision as of 09:09, 22 October 2024

To minimize the footprint Alpine Linux comes with BusyBox and it is set up as an endpoint for numerous symlinks that substitute various utilities. The utilities in BusyBox generally have fewer options and hence missing some functionality. This page explains how to get the regular utilities working as found in other Linux distributions. To replace the busybox symlinks, one needs to install the relevant packages.

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. To have the complete util-linux package:

# apk add util-linux

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:

# apk add bash bash-completion

Hardware Management

Install pciutils and usbutils for configuring PCI and USB hardware respectively. You can always remove these packages once the hardware is configured.

# apk add pciutils usbutils

The packages hwdata-pci and hwdata-usb are dependencies for the above utilities and they are installed automatically.

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

Development environment

Compiling in Alpine may be more challenging because it uses musl-libc instead of glibc. Alpine offers the regular compiler stuff such as gcc.

# apk add gcc

The alpine-sdk meta package is provided to build packages for Alpine. 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.

Functional differences between musl and glibc