Three steps in sys mode — edit the repositories file, refresh the index, upgrade everything; in-branch security updates are separate. Back up and read the release notes first.
Point at the new branch
setup-apkrepos
e opens it in vi; or in one line, moving 3.22 to 3.23:
sed -i -e 's/ v3.22 / v3.23 /g' /etc/apk/repositories
http://dl-3.alpinelinux.org/alpine/v3.22/main
http://dl-3.alpinelinux.org/alpine/v3.22/community
latest-stable avoids editing the file each release:
http://dl-3.alpinelinux.org/alpine/latest-stable/main
http://dl-3.alpinelinux.org/alpine/latest-stable/community
⚠️
latest-stablealso means an unexpected release upgrade can begin on its own — the trade for never editing the file again.
Upgrade
apk update
apk add --upgrade apk-tools
apk upgrade --available
Upgrading apk-tools first costs nothing and is sometimes required; --available upgrades every package even at matching versions, as musl changes occasionally require.
-U / --update-cache equals apk update just before it, but refreshes only a stale index; apk upgrade -U is shorthand.
Restart services after upgrade; a kernel upgrade needs a reboot:
sync
reboot
Moving to edge
Same procedure, every entry on edge:
#/media/cdrom/apks
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing
Downgrading from edge is unsupported: the documented order is apk fix, apk update, apk upgrade, apk upgrade -a, apk upgrade -al; a package may then need removing and reinstalling by hand.