Pacman and apk
Quick answer
Arch Linux uses Pacman, while Alpine Linux uses apk (Alpine Package Keeper). Their commands and upgrade models are different from Debian and from each other.
Prepare the practice environment
Use an ordinary user in a disposable VM of the distribution named in the example. For Debian examples use python3 lab-fixtures/packages/setup.py from the extracted package root, enter the printed directory and check pwd; alternatively create a private directory with mktemp -d. Use a fresh directory per example, export LC_ALL=C and Bash with set -o pipefail. Do not use sudo. Keep -s and --no-download on every APT simulation. Skip missing tools; do not install them merely to run an example. On Alpine the simple query also works in a compatible sh. Outputs vary by installed versions and repository state. Stop on unexpected failure.
How it works
On Arch, pacman -Q NAME queries installed packages and pacman -Qi NAME shows details. A supported full system update is normally pacman -Syu; refreshing indexes alone and then installing selected newer packages risks an unsupported partial upgrade. On Alpine, apk info -e NAME checks installed membership, apk info -L NAME lists package files, apk update refreshes indexes and apk upgrade upgrades packages under configured repositories. Alpine often uses BusyBox and musl rather than GNU utilities and glibc. Package names and dependencies vary. All real changes remain VM-only.
In the Arch examples, the first query answers which version is recorded and the second gives more details about that record. The Alpine membership example deliberately prints not confirmed rather than not installed on failure: a failed query is not conclusive without inspecting its diagnostic. Do not copy package names or upgrade commands between distributions simply because their purpose is similar. Confirm the distribution and installed tool first; the examples are read-only queries for their respective VMs.
Try the examples
Arch VM with bash installed: expect its name and version.
Manual example; not executed locally. Follow its stated environment restrictions.
Inspect the installed version, dependencies and installation reason; output varies.
Manual example; not executed locally. Follow its stated environment restrictions.
if apk info -e busybox >/dev/null; then printf "busybox installed\n"; else printf "not confirmed\n"; fiUse an Alpine VM with apk and BusyBox installed. Expected message is busybox installed. A nonzero query can also indicate an error; inspect diagnostics.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Do not copy apt commands into Arch or Alpine; do not use pacman -Sy followed by an isolated package installation as a normal update workflow.
Practice
Use separate Arch and Alpine VMs. Identify each distribution, query one installed package, and explain why the same command is not portable across both.
Related references
Study: pacman, apk. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Pacman and apk — Knowledge Check
Apply package-management concepts to the stated distribution and query-only lab.
Which package manager belongs to Alpine?
Which Pacman operation queries installed records?
Why avoid partial upgrades on Arch?
What should you verify before reusing a Debian script on Alpine?