Upgrading from older versions: Difference between revisions

From Alpine Linux
(Add categories)
m (→‎Upgrading Alpine v2.x to v3.x: Attempt to improve text flow in warning box.)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Note|You will need to restart any services that have been upgraded to begin using the upgraded versions. If the kernel is upgraded, you will need to reboot to begin using the upgraded version.}}
=== 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 for Alpine 3.20.0#grub 2.12|release notes]]
=== Upgrading Alpine v2.x to v3.x ===


== Upgrading from 2.1 to Alpine Linux 2.2 and later ==
{{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.<br>
Since '''apk''' tool has been significantly changed first make sure you have upgraded ''apk-tools'' package to latest version available in 2.1 repositories:
::These versions are ANCIENT and sourcing compatible APKs will be difficult.}}


{{Cmd|apk update --update-cache
==== Installing statically linked tools ====
apk add --upgrade apk-tools}}


Change repositories:
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.
{{Cat|/etc/apk/repositories|
 
http://nl.alpinelinux.org/alpine/v2.2/main
{{Cmd|apk add busybox-static apk-tools-static}}
# or any other mirror
 
}}
==== Changing repositories to v3.x ====
 
To begin, you need to update your {{Path|/etc/apk/repositories}} file. Here are some shortcuts for doing so:
:* Launch {{Cmd|setup-apkrepos}} Enter {{Key|e}} to edit {{Path|/etc/apk/repositories}}. Change the version number by hand.
:* Or, edit the file in place. This is how you'd change <var>v2.7</var> to <var>v3.0</var>: {{Cmd|sed -i -e 's/<var>v2\.7</var>/<var>v3.0</var>/g' /etc/apk/repositories}}
 
==== Upgrading system ====
 
Use statically linked version of apk to update content of repository:
 
{{Cmd|apk.static update}}
 
Simulating upgrade is recommended in order to detect issues beforehand:


Proceed with update and upgrade. The --available switch is used to force all packages to be upgraded, even if they have the same version number, due to changes in uClibc:
{{Cmd|apk.static upgrade --no-self-upgrade --available --simulate}}
{{Cmd|apk update --update-cache
apk upgrade --available --update-cache}}


Reboot the system to load new kernel
With no problems encountered or after resolving them, start proper upgrade:
{{Cmd|sync
reboot}}


{{Cmd|apk.static upgrade --no-self-upgrade --available}}


== Upgrading from 2.0 or 1.10.x to Alpine Linux 2.2 and later ==
=== Upgrading from 2.0 or 1.10.x to Alpine Linux 2.2 and later ===
Since '''apk''' tool has been significantly changed you need to download and install manually the latest version of ''apk-tools-static'' package.<BR>
<div class="toccolours mw-collapsible mw-collapsed">
And we install ''busybox-static'' just in case something goes wrong.
<div class="mw-collapsible-content">
Since the '''apk''' tool has been significantly changed you need to download and install manually the latest version of {{Pkg|apk-tools-static}}. We also install {{Pkg|busybox-static}} just in case something goes wrong.


If current version is 1.10.x remove GNU Wget before attempting an upgrade:
If current version is 1.10.x remove GNU Wget before attempting an upgrade:
{{Cmd|apk del wget}}
{{Cmd|apk del wget}}


Download busybox-static package:
Download {{Pkg|busybox-static}} and install it:
{{Cmd|wget http://nl.alpinelinux.org/alpine/v2.2/main/x86/busybox-static-1.18.4-r2.apk
{{Cmd|wget https://nl.alpinelinux.org/alpine/v3.0/main/x86/busybox-static-1.22.1-r9.apk
apk add busybox-static-1.18.4-r2.apk --update-cache}}
apk add busybox-static-1.22.1-r9.apk}}


Download latest apk-tools package and install it:
Download {{Pkg|apk-tools-static}} and install it:
{{Cmd|wget http://nl.alpinelinux.org/alpine/v2.2/main/x86/apk-tools-static-2.1.0-r1.apk
{{Cmd|wget https://nl.alpinelinux.org/alpine/v3.0/main/x86/apk-tools-static-2.4.4-r0.apk
apk add apk-tools-static-2.1.0-r1.apk --update-cache}}
apk add apk-tools-static-2.4.4-r0.apk}}


Change repositories:
Change repositories:
{{Cat|vi /etc/apk/repositories|
{{Cat|/etc/apk/repositories|...
http://nl.alpinelinux.org/alpine/v2.2/main
https://nl.alpinelinux.org/alpine/v2.2/main
# or any other mirror  
# or any other mirror
}}
}}


Proceed with update and upgrade. The --available switch is used to force all packages to be upgraded, even if they have the same version number, due to changes in uClibc:
Proceed with update and upgrade:
{{Cmd|apk.static update --update-cache
{{Cmd|apk.static update
apk.static upgrade --available --update-cache}}
apk.static upgrade --available}}
The <code>--available</code> switch is used to force all packages to be upgraded, even if they have the same version number, due to changes in uClibc.


Reboot the system to load new kernel
Reboot the system to load new kernel
{{Cmd|sync
{{Cmd|sync
reboot}}
reboot}}


[[Category:Installation]]
[[Category:Installation]]
[[Category:Package Manager]]
[[Category:Package Manager]]

Latest revision as of 06:48, 6 January 2024

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

Since the apk tool has been significantly changed you need to download and install manually the latest version of apk-tools-static. We also install busybox-static just in case something goes wrong.

If current version is 1.10.x remove GNU Wget before attempting an upgrade:

apk del wget

Download busybox-static and install it:

wget https://nl.alpinelinux.org/alpine/v3.0/main/x86/busybox-static-1.22.1-r9.apk apk add busybox-static-1.22.1-r9.apk

Download apk-tools-static and install it:

wget https://nl.alpinelinux.org/alpine/v3.0/main/x86/apk-tools-static-2.4.4-r0.apk apk add apk-tools-static-2.4.4-r0.apk

Change repositories:

Contents of /etc/apk/repositories

... https://nl.alpinelinux.org/alpine/v2.2/main # or any other mirror

Proceed with update and upgrade:

apk.static update apk.static upgrade --available

The --available switch is used to force all packages to be upgraded, even if they have the same version number, due to changes in uClibc.

Reboot the system to load new kernel

sync reboot