Alpine 基本配置
1、配置ip
配置文件 /etc/network/interfaces
- 配置DHCP
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
- 配置静态IP
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.1.1.12 netmask 255.255.255.0 gateway 10.1.1.2 dns1 114.114.114.114
重启服务/etc/init.d/networking restart
2、更换apk源
- 查看alpine版本
localhost:~# cat /etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.17.0 PRETTY_NAME="Alpine Linux v3.17" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
- 更换apk源
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
- 国内常用apk源(根据版本选择对应源)
清华镜像源:https://mirror.tuna.tsinghua.edu.cn/alpine/
阿里镜像源:https://mirrors.aliyun.com/alpine/
中科大镜像源:http://mirrors.ustc.edu.cn/alpine/
3、apk常用命令
- 安装软件
apk add 软件名 apk add --allow-untrusted /path #本地安装
- 删除软件
apk del 软件名
- 升级软件
apk upgrade
- 列出已安装的软件信息
apk info
- 通过名字或描述搜索软件
apk search
- 从仓库下载软件到本地目录,.apk包
apk fetch
温馨提示:如无特殊说明,本站文章均为作者原创,转载请注明出处!