Alpine linux’s focus seems to be on being small and secure. A lot of things in Alpine linux are being done using the apk (Alpine Package Keeper) command.
Basic commands in Alpine linux
- You can check the current apk version by running the following command:
apk --version
Packages and repositories in Alpine linux
- Remove all the old formed cache from packages in Alpine linux by running the following command:
apk cache clean
apk -v cache clean
- Start fresh: clean packages caches and download missing packages in Alpine linux using the following command:
apk cache -v sync
- For example, in order to update and upgrade Alpine linux repositories:
apk update && apk upgrade
- To view all packages available in Alpine linux, we can use:
apk search -v
- To search for a particular package and in their description in Alpine linux, we can use:
apk -v -d "package_name"
- Or to confirm installation of the packages in Alpine linux, using the following command:
apk add package_name1 package_name2
- Or to confirm package upgrade in Alpine linux:
apk upgrade package_name
- To delete a specific package in Alpine linux, we can use the following command:
apk del package_name1 package_name2
- To view all current installed packages in Alpine linux, we can use the following command:
apk info
- To check if a certain package is installed in Alpine linux, we use the following command:
apk -e info package_name
- And if we need to manually install an .apk package in Alpine linux, we can use the following command:
apk --allow-untrusted path/to/package1.apk path/to/package2.apk