Alpine Linux comes with BusyBox. It is described as, “The Swiss Army Knife of Embedded Linux.” BusyBox combines tiny versions of many common UNIX utilities into a single small executable including /bin/sh. By default, bash is not included with BusyBox and Alpine Linux.
How do install bash in Alpine Linux
It is easy to have bash installed but this does not mean the symlinks to busybox are gone. The syntax is:
# apk update
# apk upgrade
# apk add bash
(1/5) Installing ncurses-terminfo-base (6.0-r7) (2/5) Installing ncurses-terminfo (6.0-r7) (3/5) Installing ncurses-libs (6.0-r7) (4/5) Installing readline (6.3.008-r5) (5/5) Installing bash (4.3.48-r1) Executing bash-4.3.48-r1.post-install Executing busybox-1.26.2-r5.trigger OK: 14 MiB in 21 packages
To install bash documentation, enter: To use bash as a shell just type bash: Replace it with /bin/bash: Here is a sample file: See Customize the bash shell environments wiki page for more info.
# apk add bash-doc
To install bash automatic command line completion install, run:
# apk add bash-completion
To login to alpine Linux LXD vm from host, enter:
$ lxc exec alpine-lxd-vm-name-here bash
To change root shell to bash, enter:
# vi /etc/passwd
Find user name and the default shell such as /bin/ash:
Customize bash shell
alias update='apk update && apk upgrade'
export HISTTIMEFORMAT="%d/%m/%y %T "
export PS1='\u@\h:\W \$ '
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
To use bash as a shell just type bash:
Replace it with /bin/bash:
Here is a sample file:
See Customize the bash shell environments wiki page for more info.