Upgrading from older versions

From Alpine Linux
Revision as of 06:48, 6 January 2024 by Zcrayfish (talk | contribs) (→‎Upgrading Alpine v2.x to v3.x: Attempt to improve text flow in warning box.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Upgrading Alpine ≤v3.19 to v3.20.0

When upgrading existing installations using grub, make sure to update the installed bootloader before rebooting, otherwise your machine might not boot. For more information on this issue, please check the release notes

Upgrading Alpine v2.x to v3.x

Warning: Alpine Linux 3.x switched to a different libc implementation compared to previous versions. Because the new Musl libc is not ABI compatible with uClibc, there are additional steps required for an upgrade.
These versions are ANCIENT and sourcing compatible APKs will be difficult.


Installing statically linked tools

Statically linked version of apk-tools is needed, because the old musl version would stop working after a libc change (possibly in the middle of upgrade). Static version of busybox can be handy in case of the recovery from a failure.

apk add busybox-static apk-tools-static

Changing repositories to v3.x

To begin, you need to update your /etc/apk/repositories file. Here are some shortcuts for doing so:

  • Launch

    setup-apkrepos

    Enter e to edit /etc/apk/repositories. Change the version number by hand.
  • Or, edit the file in place. This is how you'd change v2.7 to v3.0:

    sed -i -e 's/v2\.7/v3.0/g' /etc/apk/repositories

Upgrading system

Use statically linked version of apk to update content of repository:

apk.static update

Simulating upgrade is recommended in order to detect issues beforehand:

apk.static upgrade --no-self-upgrade --available --simulate

With no problems encountered or after resolving them, start proper upgrade:

apk.static upgrade --no-self-upgrade --available

Upgrading from 2.0 or 1.10.x to Alpine Linux 2.2 and later