Alpine Linux

更新于 2024-08-05

设置Alpine

setup-alpine

时区设置

apk update && apk add tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone

修改镜像源

vi /etc/apk/repositories

https://mirrors.ustc.edu.cn/alpine/latest-stable/main
https://mirrors.ustc.edu.cn/alpine/latest-stable/community

#或者
sed -i 's@dl-cdn.alpinelinux.org@mirrors.ustc.edu.cn@g' /etc/apk/repositories

安装GCC工具包

apk add -y gcc g++ make automake autoconf libtool binutils zlib-dev icu-libs

网卡配置

/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
      address 172.25.153.8
      netmask 255.255.240.0
      gateway 172.25.144.1
      dns-nameservers 223.5.5.5 8.8.8.8
      metric 100 #多网卡调整metric,或者内网网卡不配置网关

重启网络服务

service networking restart
/etc/init.d/networking restart