How to get regular stuff working: Difference between revisions

From Alpine Linux
(rephrased paragraph and moved the subpackage definition to apk page)
 
(54 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== Man pages ==
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.


Not all man-pages are in Alpine, those who are are not readily available after installing man and man-pages,
== Core utilities ==
you also need to install mdocml-pages to have man pages built at install time. Below is the quick and easy commandline:
{{Main|GNU core utilities}}


    apk add man man-pages mdocml-pages
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}}}}


== Operational hints ==
== Util-linux ==


==== Shell @ commandline ====
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}}}}


Alpine comes with busybox by default, busybox is and endpoint for numerous symlinks for various utilities. Though busybox is not that bad the commands are impaired in functionality.
The full featured file pager utility <code>less</code> can be installed from the {{pkg|less}} package.


* funny characters at the console
== 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
== Bash shell ==
It is easy enough to have bash installed but this does not mean the symlinks to busybox are gone
{{Main|Change default shell}}
The default shell used by Alpine Linux is the busybox variant of the [[BusyBox#Ash_shell|ash shell]]. To install {{pkg|bash}} shell: {{Cmd|# apk add {{pkg|bash}} {{pkg|bash-completion}}}}


install bash like 
== Hardware Management ==
  apk add bash bash-doc bash-completion


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}}}}


* shell utils ( things like grep, awk, ls, brctl  ... are all busybox symlinks )
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.


  this should document how to have real utils instead of symlinks to busybox
== Disk Management ==


==== Disk Management ====
Managing (removable) disks is much easier with udisks. {{Cmd|# apk add {{pkg|udisks2}}}}


Disk management is soo much easier with udisks or udisks2
To see the mounted disks:{{Cmd|# udisksctl status}}


Installation   
== Network Management ==


  apk add udisks2 udisks2-doc
For network, you may want to install {{pkg|iproute2}}. {{Cmd|# apk add {{pkg|iproute2}}}}


See the mounted disks
== Subpackages and missing functionality  ==


  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.


== Compiling : a few notes and a reminder  ==
For eg: [https://networkmanager.dev/ NetworkManager], a popular 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.


Compiling in Alpine may be more challenging because it uses [http://www.musl-libc.org/ musl-libc] instead of glibc. Please review [http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc 'The functional differences with glibc' ] if you think of porting packages or just for the sake of knowing, of course.
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.


Alpine offers the regular compiler stuff like gcc and cmake ... possible others
== Development environment ==


==== (unvalidated) apk packages to install so one can start building software ====
Compiling in Alpine Linux may be more challenging because it uses [https://musl.libc.org/ musl-libc] instead of glibc. The {{pkg|build-base}} meta package provides regular compiler stuff such as {{pkg|binutils}}, {{pkg|gcc}}, {{pkg|g++}}, {{pkg|make}} etc..
  apk add build-base gcc abuild


==== a complete install for cmake looks like ====
{{Cmd|# apk add {{pkg|build-base}}}}


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


==== ccache is also available ====
{{Cmd|# apk add {{pkg|alpine-sdk}}}}


  apk add ccache ccache-doc
To install CMake:
 
{{Cmd|# apk add {{pkg|cmake}} {{pkg|extra-cmake-modules}}}}
 
{{pkg|ccache}} and a lot other tools are also available in Alpine Linux.
 
[[Category:Installation]]
[[category: System Administration]]

Latest revision as of 04:31, 3 March 2025

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.