Alpine Linux源管理 1.国内源简介: 这几个都有alpine的源 清华大学:https://mirror.tuna.tsinghua.edu.cn/alpine/ 阿里云:https://mirrors.aliyun.com/alpine/ 中科大:http://mirrors.ustc.edu.cn/alpine/ 网易:http://mirrors.163.com/ 2.配置: 直接抄中科大的帮助http://mirrors.ustc.edu.cn/help/alpine.html 一般情况下,将 /etc/apk/repositories 文件中 Alpine 默认的源地址 http://dl-cdn.alpinelinux.org/ 替换为 http://mirrors.ustc.edu.cn/ 即可。 sudo vi /etc/apk/repositories Alpine Linux 包管理 1.简介 Alpine使用apk进行包管理,下面介绍常用命令 2.apk update apk update #更新最新镜像源列表 3.apk search apk search #查找所以可用软件包 apk search -v #查找所以可用软件包及其描述内容 apk search -v 'acf*' #通过软件包名称查找软件包apk search -v -d ‘docker’ #通过描述文件查找特定的软件包 4.apk add apk add openssh #安装一个软件 apk add openssh openntp vim #安装多个软件 apk add --no-cache mysql-client #不使用本地镜像源缓存,相当于先执行update,再执行add 5.apk info apk info #列出所有已安装的软件包 apk info -a zlib #显示完整的软件包信息 apk info --who-owns /sbin/lbu #显示指定文件属于的包 6.apk upgrade apk upgrade #升级所有软件 apk upgrade openssh #升级指定软件 apk upgrade openssh openntp vim #升级多个软件 apk add --upgrade busybox #指定升级部分软件包 7.apk del apk del openssh #删除一个软件 安装python sudo apk add --no-cache python3 python3-dev 其中已自带pip python其他依赖 sudo pip3 install Flask -i http://pypi.douban.com/simple --trusted-host pypi.douban.com sudo pip install paho-mqtt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com sudo pip install redis -i http://pypi.douban.com/simple --trusted-host pypi.douban.com sudo pip install requests -i http://pypi.douban.com/simple --trusted-host pypi.douban.com Alpine Linux服务管理 1.简介 alpine没有使用fedora的systemctl来进行服务管理,使用的是RC系列命令 未安装openrc时需执行以下命令 sudo apk add --no-cache openrc 2.rc-update rc-update主要用于不同运行级增加或者删除服务。 alpine:~# rc-update --help Usage: rc-update [options] add [...] or: rc-update [options] del [...] or: rc-update [options] [show [...]] Options: [ asuChqVv ] -a, --all Process all runlevels -s, --stack Stack a runlevel instead of a service -u, --update Force an update of the dependency tree -h, --help Display this help output -C, --nocolor Disable color output -V, --version Display software version -v, --verbose Run verbosely -q, --quiet Run quietly (repeat to suppress errors) 3.rc-status rc-status 主要用于运行级的状态管理。 alpine:~# rc-status --help Usage: rc-status [options] ... or: rc-status [options] [-a | -c | -l | -m | -r | -s | -u] Options: [ aclmrsuChqVv ] -a, --all Show services from all run levels -c, --crashed Show crashed services -l, --list Show list of run levels -m, --manual Show manually started services -r, --runlevel Show the name of the current runlevel -s, --servicelist Show service list -u, --unused Show services not assigned to any runlevel -h
Alpine Linux 安装SSH samba-server python3
于 2022-03-20 14:55:50 首次发布
本文介绍了如何在Alpine Linux上安装SSH服务,并进行启动及配置,包括设置开机启动和调整配置文件。接着,详细讲解了安装Samba服务器的过程,包括创建共享目录、配置smb.conf文件、创建系统用户和Samba用户,以及启动Samba服务。最后,提到了防火墙和端口变更的相关注意事项。
摘要由CSDN通过智能技术生成