linux apk 命令

Alpine Linux 下的包管理工具

使用实例

apk install xxxapk search xxx # 支持正则apk info xxx # 查看包的详细信息apk show # list local package 卸载并删除 包apk del openssh openntp vim

升级

upgrade命令升级系统已安装的所以软件包(一般包括内核),当然也可指定仅升级部分软件包(通过-u或-upgrade选择指定)。

apk update # 更新最新本地镜像源apk upgrade # 升级软件apk add --upgrade busybox # 指定升级部分软件包

搜索

apk search # 查找所以可用软件包apk search -v # 查找所以可用软件包及其描述内容apk search -v 'acf*' # 通过软件包名称查找软件包apk search -v -d 'docker' # 通过描述文件查找特定的软件包

查看包信息

info命令用于显示软件包的信息。

apk info # 列出所有已安装的软件包apk info -a zlib # 显示完整的软件包信息apk info --who-owns /sbin/lbu # 显示指定文件属于的包

笔记

还是蛮喜欢 alpine 的,简单纯粹

apk add iproute2 # ss vs netstatss -ptlapk add drill # drill vs nslookup&digcrond # 开启 cron 服务crontab -l -eapk add xxxapk search -v xxxapk info -a xxxapk infoecho -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositoriesapk update storageibu # alpine local backup networkecho "shortname" > /etc/hostnamehostname -F /etc/hostname/etc/hosts/etc/resolv.conf # conig DNSmodprobe ipv6 # enable ipv6echo "ipv6" >> /etc/modulesiface # config interfaceapk add iptables ip6tables iptables-doc/etc/init.d/networking restart # activate changeapke add iputils # IPv6 traceroutetraceroute6 ipv6.google.comawall # alpine wall setup a openvpn server post-install/etc/apk/repositoriesapk add cherokee --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrustedapk search -v --description 'NTP' # show description and search from descriptionapk info -a zlibapk info -vv|sortapk info -r -R # require / depencyapk version -v -l '<' # show available updatesapk upgrade -U -aapk add -u xxx # update xxx/etc/runlevels # runlevelapk add openrc # use openrc for init systemrc-update add xxx # set to start onrc-service xxx start # equal -> /etc/init.d/xxx startrc-statusadduser xxxpasswd xxxapk add ansible # serverssh-keygen/etc/ansible/hostsapk add python # nodessh-copy-idapk add man man-pages mdocml-apropos less less-docexport PAGER=less/etc/rc.conf # /etc/rc.conf -> funny characterapk add bash bash-doc bash-completion # bashapk add util-linux pciutils usbutils coreutils binutils findutils grep # grep / awkapk add build-base gcc abuild binutils binutils-doc gcc-doc # compileapk add cmake cmake-doc extra-cmake-modules extra-cmake-modules-docapk add ccache ccache-docapk add docker # dockerrc-update add docker bootrc-service docker startapk add py-pippip install docker-composeln -s /usr/bin/docker-compose /usr/bin/doc applicationapk add openssh # sshrc-update add sshd/etc/init.d/sshd start/etc/sshd_configapk add dropbear # another openssh implementation

文档来源 https://github.com/jaywcjlove/linux-command

Was this helpful?

0 / 0

发表回复 0