foreword
Alpine provides a very useful apk package management tool. View complete package management commands through the apk –help command.
update index
update: Update the local mirror source index from the remote mirror source. The update command will download APKINDEX.tar.gz from each mirror source list and store it in the local cache, usually in /var/cache/apk/ (Alpine is in this directory), /var/lib/apk/ , /etc/apk/cache/
apk update
Installation package
add: The command installs the latest software package from the repository, and automatically installs the necessary dependency packages. You can also add packages from third-party repositories. add: Install PACKAGES and resolve dependencies automatically.
apk add openssh openntp vim
apk add --no-cache mysql-client
apk add docker --update-cache --repository http://mirrors.ustc.edu.cn/alpine/v3.4/main/ --allow-untrusted
Install the specified version package
apk add asterisk=1.6.0.21-r0
apk add 'asterisk<1.6.1'
apk add 'asterisk>1.6.1
uninstall
del: uninstall and delete PACKAGES
apk del openssh openntp vim
upgrade
The upgrade command upgrades all the software packages (usually including the kernel) installed in the system, of course, it can also specify to upgrade only some software packages (specified by -u or --upgrade option).
apk update #Update the latest local mirror source
apk upgrade #Upgrade software
apk add --upgrade busybox #Specify to upgrade some software packages
search
The search command searches for available packages, the -v parameter outputs the description content, and the expenditure wildcard, -d or --description parameter specifies the query through the package description.
apk search #Find all available packages
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 #显示指定文件属于的包