Alpine Linux 原始安装的是 busybox,小巧精干,但毕竟与主流的 Bash 还是有区别,特别是与其它系统联动时会比较麻烦,所以还是安装 Bash,统一 Shell 环境,方便日后使用。
而且基本网上的安装教程都有问题,所以这里给出正确的安装步骤。
$ apk add bash libuser
$ touch /etc/login.defs
$ mkdir /etc/default
$ touch /etc/default/useradd
$ lchsh <root>
Changing shell for root.
Password: <root password>
New Shell [/bin/ash]: /bin/bash
Shell changed.
# debian
apt install -y systemd-timesyncd
# almalinux
# systemd 是默认安装且无法卸载的核心基础包
# 设置时区
timedatectl set-timezone Asia/Shanghai
# 启动NTP服务
timedatectl set-ntp true
; debian
; /etc/systemd/timesyncd.conf
[Time]
NTP=ntp.ntsc.ac.cn
FallbackNTP=ntp.aliyun.com ntp.tencent.com 0.cn.pool.ntp.org
# debian
# 在LXC、Docker 或某些 VPS 环境中
dpkg-reconfigure tzdata
systemctl stop 'postfix@*' ; systemctl disable 'postfix@\x2a' ;
# debian
apt purge -y postfix
# almalinux
dnf remove -y postfix