TrumanWong

apk

Package management tool under Alpine Linux

Usage examples

apk installxxx
apk search xxx # Support regular expressions
apk info xxx # View package details
apk show # list local package
# Uninstall and delete the package
apk del openssh openntp vim

upgrade

The upgrade command upgrades all software packages installed on the system (generally including the kernel). Of course, you can also specify to upgrade only some software packages (specify through -u or –upgrade selection).

apk update # Update the latest local image source
apk upgrade # Upgrade software
apk add --upgrade busybox #Specify to upgrade some software packages

search

apk search # Find all available software packages
apk search -v # Search all available software packages and their descriptions
apk search -v 'acf*' # Search for packages by package name
apk search -v -d 'docker' # Find specific software packages through description files

View package information

The info command is used to display software package information.

apk info # List all installed packages
apk info -a zlib # Display complete package information
apk info --who-owns /sbin/lbu # Display the package to which the specified file belongs

Notes

I still like alpine, simple and pure

apk add iproute2 # ss vs netstat
ss-ptl
apk add drill # drill vs nslookup&dig

crond # Start cron service
crontab -l -e

apk addxxx
apk search -v xxx
apk info -a xxx
apkinfo
echo -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositories
apk update

#storage
ibu # alpine local backup

# network
echo "shortname" > /etc/hostname
hostname -F /etc/hostname
/etc/hosts
/etc/resolv.conf # conig DNS
modprobe ipv6 # enable ipv6
echo "ipv6" >> /etc/modules
iface #config interface
apk add iptables ip6tables iptables-doc
/etc/init.d/networking restart # activate change
apke add iputils # IPv6 traceroute
traceroute6 ipv6.google.com
awall #alpine wall
# setup an openvpn server

# post-install
/etc/apk/repositories
apk add cherokee --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
apk search -v --description 'NTP' # show description and search from description
apk info -a zlib
apk info -vv|sort
apk info -r -R # require / depency
apk version -v -l '<' # show available updates
apk upgrade -U -a
apk add -u xxx # update xxx

/etc/runlevels # runlevel
apk add openrc # use openrc for init system
rc-update add xxx # set to start on
rc-service xxx start # equal -> /etc/init.d/xxx start
rc-status

adduserxxx
passwdxxx

apk add ansible # server
ssh-keygen
/etc/ansible/hosts
apk add python # node
ssh-copy-id

apk add man man-pages mdocml-apropos less less-doc
export PAGER=less
/etc/rc.conf # /etc/rc.conf -> funny character
apk add bash bash-doc bash-completion # bash
apk add util-linux pciutils usbutils coreutils binutils findutils grep # grep / awk
apk add build-base gcc abuild binutils binutils-doc gcc-doc # compile
apk add cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc
apk add ccache ccache-doc

apk add docker #docker
rc-update add docker boot
rc-service docker start
apk add py-pip
pip install docker-compose
ln -s /usr/bin/docker-compose /usr/bin/doc

#application
apk add openssh # ssh
rc-update add sshd
/etc/init.d/sshd start
/etc/sshd_config
apk add dropbear # another openssh implementation