Alpine Linux comes with BusyBox. It is described as “The Swiss Army Knife of Embedded Linux.” BusyBox combines tiny versions of many standard UNIX utilities into a single small executable, including /bin/sh. By default, bash is not included with BusyBox and Alpine Linux. The postmarketOS project, which is designed to run on mobile devices, is based on Alpine Linux. Many Docker images are also based upon Alpine, and you may install bash shell in Docker-based images too. This page shows how to install a bash shell in Alpine Linux using the apk command.

ADVERTISEMENTS

How do I install bash shell in Alpine Linux?

It is easy to have bash installed but this does not mean the symlinks to busybox are gone. The syntax is as follows with apk command:

# apk update

# apk upgrade

# apk add bash

Sample outputs:

(1/4) Installing ncurses-terminfo-base (6.1_p20200118-r4)
(2/4) Installing ncurses-libs (6.1_p20200118-r4)
(3/4) Installing readline (8.0.1-r0)
(4/4) Installing bash (5.0.11-r1)
Executing bash-5.0.11-r1.post-install
Executing busybox-1.31.1-r9.trigger
OK: 11 MiB in 23 packages

Get a list of valid login shells on Alpine Linux using the cat command:

# cat **/etc/shells**

Outputs:

# valid login shells
/bin/sh
/bin/ash
/bin/bash

#alpine linux #bash #alpine linux #busybox

How to install bash shell in Alpine Linux
116.00 GEEK