Upgrading Alpine: Difference between revisions

From Alpine Linux
m (Reverted edits by 80.227.1.101 (Talk); changed back to last version by Ncopa)
(→‎Upgrading system: we need --available when upgrading from v2.7 to v3.0)
(24 intermediate revisions by 7 users not shown)
Line 1: Line 1:
= Upgrading Alpine =
{{Warning|Make sure that you have a backup of your important data before continuing to update your system.}}


This document describes how to replace an Alpine installation with a newer version.
== Upgrading an Alpine Linux Hard-disk installation ==


The upgrade process consist of the following steps:
=== Upgrading Alpine v2.x to v3.x ===
* Backup current setup
* Download new version of Alpine
* Replace packages
* Merge config
* Reboot


=== Backing up current config ===
{{Warning|Alpine Linux 3.x is using a different libc implementation compared to previous versions. Musl libc is not ABI compatible with uClibc. Additional steps are required for an upgrade.}}
Its recommended to make a backup of your config before you start. You can do that by simply replacing the floppy with a new floppy and keep the old one in case you will need to do a rollback. If you store config on USB you migh copy the config file (*apkovl*) to a safe place.


If you use the USB installation and not the CDROM, you can just create a directory on the USB called ''old'' and move everything to this dir.
==== Installing statically linked tools ====
mkdir /media/usb/old
mv /media/usb/* /media/usb/old/


Note that this command will try to move the ''old'' directory into itself which will give an error message. You can safely ignore this.
Statically linked version of apk-tools is needed, otherwise it will stop working after libc upgrade (possibly in the middle of upgrade). Static version of busybox can be handy in case of the recovery from a failure.


If you need to rollback, simply move the contents in directory ''old'' back to the root of USB.
{{Cmd|apk add busybox-static apk-tools-static}}


=== Download new Alpine ===
==== Changing repositories to v3.x ====
Download and burn the new [http://dev.alpinelinux.org/alpine/v1.7/iso ISO image] on a separate computer. Replace the CDROM and mount it.


On USB installations you can just download and unpack the latest tar directly to ''/media/usb''.
To begin, you need to update your {{Path|/etc/apk/repositories}} file. Here are some shortcuts for doing so:
$ wget -C /media/usb -q -O - \
:* Launch {{Cmd|setup-apkrepos}} Enter {{Key|e}} to edit {{Path|/etc/apk/repositories}}. Change the version number by hand.
      http://dev.alpinelinux.org/alpine/v1.7/usbdrive/alpine-1.7.6-i386.tar.gz \
:* 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}}
      | tar -zvx


=== Execute upgrade script ===
==== Upgrading system ====
Execute the ''upgrade'' script found on root level on media. (/media/cdrom/upgrade or /media/usb/upgrade). Before actually upgrading packages it will give an overview what packages will be upgraded. It migh look something like this:
<pre>~ $ /media/usb/upgrade
Upgrading from alpine-1.7.2 to alpine-1.7.6
Will try to upgrade packages from
fetching usb://apks/INDEX.md5.gz
Looking for new packages...
The following packages will be updated:
alpine-baselayout-1.4.1-r1          <  needs updating (index has 1.6.0)
alpine-conf-0.9                    <  needs updating (index has 1.0)
bind-tools-9.4.1-r1                <  needs updating (index has 9.4.1_p1)
busybox-1.5.0-r1                    <  needs updating (index has 1.7.1)
iproute2-2.6.19.20061214            <  needs updating (index has 2.6.20.20070313)
iptables-1.3.5-r4                  <  needs updating (index has 1.3.8-r1)
libpcap-0.9.5                      <  needs updating (index has 0.9.7)
openssh-4.5_p1-r1                  <  needs updating (index has 4.7_p1-r1)
openssl-0.9.8d                      <  needs updating (index has 0.9.8e-r2)
openswan-2.4.8                      <  needs updating (index has 2.5.15)
shorewall-3.4.3                    <  needs updating (index has 3.4.6)
shorewall-doc-3.4.2                <  needs updating (index has 3.4.6)
tcpdump-3.9.5-r2                    <  needs updating (index has 3.9.7-r1)


Press Enter to continue or Ctrl-c to abort.
Use statically linked version of apk to update content of repository:
</pre>


Verify that it looks ok and press ''enter'' to start the upgrade.
{{Cmd|apk.static update}}


As a first step the upgrade script will try to upgrade apk-tools, uclibc and busybox. Then it will upgrade all packages by running ''apk_add -u''. It will look something like this:
Simulating upgrade is recommended in order to detect issues beforehand:
<pre>apk-tools-0.13 is installed. Skipping apk-tools-0.13.
uclibc-0.9.28.3 is installed. Skipping uclibc-0.9.28.3.
fetching usb://apks/busybox-1.7.1.apk
updating busybox-1.5.0-r1 to busybox-1.7.1
fetching usb://apks/alpine-baselayout-1.6.0.apk
updating alpine-baselayout-1.4.1-r1 to alpine-baselayout-1.6.0
fetching usb://apks/alpine-conf-1.0.apk
updating alpine-conf-0.9 to alpine-conf-1.0
fetching usb://apks/bind-tools-9.4.1_p1.apk
updating bind-tools-9.4.1-r1 to bind-tools-9.4.1_p1
busybox-1.7.1 is installed. Skipping busybox-1.7.1.
fetching usb://apks/iproute2-2.6.20.20070313.apk
updating iproute2-2.6.19.20061214 to iproute2-2.6.20.20070313
fetching usb://apks/iptables-1.3.8-r1.apk
updating iptables-1.3.5-r4 to iptables-1.3.8-r1
fetching usb://apks/libpcap-0.9.7.apk
updating libpcap-0.9.5 to libpcap-0.9.7
fetching usb://apks/openssh-4.7_p1-r1.apk
updating openssh-4.5_p1-r1 to openssh-4.7_p1-r1
fetching usb://apks/openssl-0.9.8e-r2.apk
updating openssl-0.9.8d to openssl-0.9.8e-r2
fetching usb://apks/openswan-2.5.15.apk
updating openswan-2.4.8 to openswan-2.5.15
fetching usb://apks/shorewall-3.4.6.apk
updating shorewall-3.4.3 to shorewall-3.4.6
fetching usb://apks/shorewall-doc-3.4.6.apk
updating shorewall-doc-3.4.2 to shorewall-doc-3.4.6
fetching usb://apks/tcpdump-3.9.7-r1.apk
updating tcpdump-3.9.5-r2 to tcpdump-3.9.7-r1
</pre>


When then '''apk_add''' application upgrades packages, it will detect that you have modified some config files. Instead of overwriting your config, it will install the new config with the suffix ''.apk-new''. This way you are able to review and merge in changes from the default config to your own config file.  Config files that are untouched will just silently be replaced.
{{Cmd|apk.static upgrade --no-self-upgrade --available --simulate}}


The ''upgrade'' script will execute ''update-conf'' to assist you in merging the config files. It will first display a list of config files that you will need to take care of manually. Like this:
With no problems encountered or after resolving them, start proper upgrade:


<pre>The following config files have been updated and need attention:
{{Cmd|apk.static upgrade --no-self-upgrade --available}}
/etc/profile
/etc/modules
/etc/inittab
/etc/hosts
/etc/shorewall/zones
/etc/shorewall/tunnels
/etc/shorewall/tos
/etc/shorewall/shorewall.conf
/etc/shorewall/rules
/etc/shorewall/policy
/etc/shorewall/params
/etc/shorewall/masq
/etc/shorewall/interfaces
/etc/shorewall/hosts
/etc/shorewall/accounting
/etc/ipsec/ipsec.conf
/etc/ipsec/ipsec.d/policies/private-or-clear
/etc/ipsec/ipsec.d/policies/private
/etc/ipsec/ipsec.d/policies/clear-or-private
/etc/ipsec/ipsec.d/policies/clear
/etc/ipsec/ipsec.d/policies/block
/etc/ipsec/ipsec.d/examples/no_oe.conf
/etc/ipsec/ipsec.d/examples/l2tp-psk.conf
/etc/ipsec/ipsec.d/examples/l2tp-psk-orgWIN2KXP.conf
/etc/ipsec/ipsec.d/examples/l2tp-cert.conf
/etc/ipsec/ipsec.d/examples/l2tp-cert-orgWIN2KXP.conf
/etc/ssh/sshd_config
/etc/ssh/ssh_config
/etc/init.d/ipsec
/etc/init.d/sshd
/etc/init.d/syslog
/etc/init.d/networking
/etc/init.d/modloop
/etc/init.d/bootmisc.sh
</pre>


Afterward it will step through every file, displaying a diff and give you options to act.
=== Upgrading to latest release ===
{{:Include:Upgrading to latest release}}


<pre>
=== Upgrading to Edge ===
--- /etc/profile        2007-05-31 14:11:47 +0000
{{:Include:Upgrading to Edge}}
+++ /etc/profile.apk-new        2007-09-07 06:33:36 +0000
@@ -1,4 +1,3 @@
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
export PAGER=less
umask 022
-export LBU_MEDIA=usb
New /etc/profile available:
Quit, Next, Show diff, Edit new, Zap new, Use new (q/n/s/e/z/u) [s]:  
</pre>


In this case we have added ''export LBU_MEDIA==usb'' so we don't need to specify the media to 'lbu''. We want to keep our current file as it is so we just press ''z'' (and ''Enter'') to zap the new config and keep the old.
=== Upgrading from older versions ===


Next is file is ''/etc/modules''
See [[Upgrading from older versions]].
<pre>
--- /etc/modules        2007-05-09 16:02:31 +0000
+++ /etc/modules.apk-new        2007-09-07 06:33:36 +0000
@@ -1,4 +1,2 @@
deadline-iosched
af_packet
-xt_state
-xt_tcpudp
New /etc/modules available:
Quit, Next, Show diff, Edit new, Zap new, Use new (q/n/s/e/z/u) [s]:
</pre>


Also here we just keep the current config by pressing ''z'' since the modules are needed for our ipsec.
== Upgrading Alpine Linux on CD ==


Next file is ''/etc/inittab'':
You may have an installation where the boot media being used (such as a CD, for example) is separate from the media used to store the configuration information. In this case, simply download the latest ISO, and replace the boot media contents with the contents of the latest ISO. If you are booting from a CD, this would simply mean replacing the CD with a CD made from the new image and rebooting the Alpine Linux box.
<pre>--- /etc/inittab        2007-06-20 13:21:20 +0000
+++ /etc/inittab.apk-new        2007-09-07 06:33:36 +0000
@@ -4,7 +4,7 @@
::wait:/etc/init.d/rcL
# Set up a couple of getty's
-::respawn:/sbin/cttyhack /sbin/getty - 9600 vt100
+::respawn:/usr/bin/cttyhack /sbin/getty - 9600 vt100
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
New /etc/inittab available:
Quit, Next, Show diff, Edit new, Zap new, Use new (q/n/s/e/z/u) [s]:
</pre>


This time the change is not caused by us, but its a change in the default config. This is even related to where the login screen should appear so if we don merge this change in we might not be able to see the login screen! We choose ''u'' to use the new config.
=== Update remaining packages from Web repository ===


Continue go through every config file. Sometimes you might want to edit the new file, or leave the upgrade process to take care of the config file manually by using option ''q''. You can always resume later by either running the ''upgrade'' script again or by executing ''update-conf -i''.
If you are using [[How_to_enable_APK_caching|APK caching]] you should also perform the following steps.
{{:Include:Using_Internet_Repositories_for_apk-tools}}


== Rebooting ==
If you're upgrading from a version of Alpine before 2.3.0_rc1, ensure you have the latest available version of the Alpine Linux Package Manager first before upgrading anything else:
In most cases you will need to reboot Alpine, specially if there are are changes in the kernel. If you know what you are doing, you might not need to reboot. Just make sure that all services affected by the upgrade are restarted.
{{Cmd|apk add --upgrade apk-tools}}
 
Next, upgrade all your packages:
 
{{Cmd|apk upgrade --available
sync}}
 
The <code>--available</code> switch is used to force all packages to be upgraded, even if they have the same version numbers. Sometimes changes in uClibc require doing this.
 
After upgrading packages, save any configuration changes (you should have backed up your earlier configuration prior to upgrading).
{{Cmd|lbu ci}}
 
 
== Upgrading Alpine Linux on other removable media (such as CF/USB) ==
 
The following instructions are for run-from-RAM Alpine installations running on Compact Flash or USB media. Updating your repositories using [[#Upgrading_an_Alpine_Linux_Hard-disk_installation|the procedures detailed above]], then running:
{{Cmd|apk upgrade --update-cache --available}}
will suffice for some purposes. (If you want the new packages to be used after a reboot, you should [[How_to_enable_APK_caching|enable APK caching]].)
 
However, this is not an adequate general solution because it won't honor any kernel upgrades and the like. For the general solution, you'll need to upgrade your boot medium (Compact Flash or USB). That is what the following steps describe how to do.
 
{{:Include:Upgrading_Alpine_environmentvars}}
 
=== Upgrade Operating System ===
 
Start by checking that you have enough space on your media. For a '''standard''' Alpine image, you need at least 400MB available space.
{{Cmd|df -h {{!}} grep "Filesystem\{{!}}$LBU_MEDIA"}}
 
==== Download and verify new release ====
 
Make sure the media that holds your Alpine system is mounted readwrite.
{{Cmd|mount -oremount,rw /media/$LBU_MEDIA}}
 
'''If using Alpine Linux 2.2.3 or newer''': use the following command to download, mount and copy files as needed for you: {{Cmd|setup-bootable -u {{#latestalp:alpine|url}} /media/$LBU_MEDIA}} Once the command completes, proceed to the [[#Save changes|Save changes]] section.
 
==== For older versions of Alpine ====
Start downloading a new '.iso' and a '.sha1' file
{{Cmd|cd /media/$LBU_MEDIA
wget -c {{#latestalp:alpine|url}}
wget {{#latestalp:alpine|url}}.sha1}}
 
Check integrity of the downloaded files ''(it might take some time)'':
{{Cmd|sha1sum -c {{#latestalp:alpine|file}}.sha1}}
''The output of the above command should say 'OK'.<BR>''
''If says 'FAILED', delete the iso file and download it again.''
 
'''If using Alpine Linux 1.10.4 or newer''': there is a tool ''setup-bootable'' that will mount and copy the image you just downloaded to your boot medium. With this tool simply do: {{Cmd|setup-bootable -u {{#latestalp:alpine|file}} /media/$LBU_MEDIA}}
 
[[Upgrading from older versions#Upgrading_a_removable_medium_from_Alpine_before_1.10.4|Instructions for older versions of Alpine]] are located elsewhere.
 
=== Save changes ===
Now that all upgrades are done, we should save our settings to our media (which you hopefully have backed up prior to doing this upgrade).
{{Cmd|lbu ci}}
 
=== Load new kernel ===
In most cases you will need to reboot Alpine Linux (especially if there are changes in the kernel):
{{Cmd|sync
reboot}}
 
{{Note|If you know what you are doing, you might not need to reboot. But make sure that all services affected by the upgrade are restarted.}}
 
=== Update remaining packages from Web repository ===
If you are using [[How_to_enable_APK_caching|APK caching]] you should follow the instructions to [[#Update_remaining_packages_from_Web_repository|Update remaining packages from Web repository]], above.
 
 
[[Category:Installation]]
[[Category:Package Manager]]

Revision as of 13:38, 5 September 2014

Warning: Make sure that you have a backup of your important data before continuing to update your system.


Upgrading an Alpine Linux Hard-disk installation

Upgrading Alpine v2.x to v3.x

Warning: Alpine Linux 3.x is using a different libc implementation compared to previous versions. Musl libc is not ABI compatible with uClibc. Additional steps are required for an upgrade.


Installing statically linked tools

Statically linked version of apk-tools is needed, otherwise it will stop working after libc upgrade (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 to latest release

Repository Settings

First thing is to to edit or check the /etc/apk/repositories file.

Besides doing it manually (see below) this may be done using one of the following shortcuts.

  • Launching the corresponding Alpine setup script,

    setup-apkrepos

    and pressing e to edit /etc/apk/repositories. Then editing the repository lines to reflect the new version number.
  • Or, use a one-line command to edit all version numbers in the file "in place". Here's how you'd change v2.5 to v2.6:

    sed -i -e 's/v2\.5/v2\.6/g' /etc/apk/repositories

Note, subsequent manual changes of the version numbers in /etc/apk/repositories may be avoided for future release upgrades by having the repository lines refer to "latest-stable" instead of an absolute value:

Contents of /etc/apk/repositories

http://dl-3.alpinelinux.org/alpine/latest-stable/main http://dl-3.alpinelinux.org/alpine/latest-stable/community

However, beware of initiating unexpected release upgrades.

Manual editing of /etc/apk/repositories:


Edit the /etc/apk/repositories file using an editor (nano for instance) and if necessary, add references to the Alpine package repositories. In the example below, the file references the Alpine CD, so that if a requested package is available on the local media, it will be obtained from there instead of being downloaded from the remote repository:

Contents of /etc/apk/repositories

/media/cdrom/apks http://dl-3.alpinelinux.org/alpine/v3.3/main

To upgrade, in this example, from version 3.3 to 3.19, simply change:

http://dl-3.alpinelinux.org/alpine/v3.3/main

to

http://dl-3.alpinelinux.org/alpine/v3.19/main

So that the file will look like this:

Contents of /etc/apk/repositories

/media/cdrom/apks http://dl-3.alpinelinux.org/alpine/v3.19/main
Note: Starting with version 3.3, there is a new repository called community. Many packages have been moved from the main repository to the community repository to indicate that they are not guaranteed to be supported beyond six months. If you are using any of these packages, be sure to add the community repository. For example: http://dl-3.alpinelinux.org/alpine/v3.19/community

Above, only one possible repository is shown, however, http://dl-3.alpinelinux.org/alpine/ may also be replaced with any geographically close mirror from: http://rsync.alpinelinux.org/alpine/MIRRORS.txt

Updating package lists

With the correct repositories file in place, the latest index list of available packages can be obtained with:

apk update

Tip: Adding the --update-cache or -U to another apk command, as in apk add -U ... or apk upgrade -U, has the same effect as always running apk update immediately before the other apk command. Instead of auto-update it only if the index has not been updated recently.

Upgrading packages

At times it is required to first upgrade just the Alpine Linux Package Manager itself to the latest available version, before upgrading any other package. This was the case, for example, when upgrading from a version of Alpine before 2.3.0_rc1. But simply always doing so shouldn't hurt, either:

apk add --upgrade apk-tools

Next, to upgrade all installed packages:

apk upgrade --available

The --available switch is used to force all packages to be upgraded, even if they have the same version numbers. Sometimes changes in musl require doing this.

Note: All services that have been upgraded need to be restarted, to begin using the upgraded version. If the kernel is upgraded, it's required to reboot to begin using the upgraded version:

sync reboot

Upgrading to Edge

An upgrade of Alpine Linux from a stable version to the rolling development version edge basically requires the same steps as Upgrading to latest release.

The crucial difference is, that when editing the /etc/apk/repositories file, all referenced repository versions (such as v3.19 or latest-stable) therein need to be pointing to edge as in:

https://<mirror-server>/alpine/edge/main

Warning: Do not enable stable and edge repos at the same time. This can break your system. Either use edge or stable.


After upgrading to edge, the currently installed edge version may be checked with

$ cat /etc/alpine-release

and referring to the build date that is attached to the release.

Upgrading from older versions

See Upgrading from older versions.

Upgrading Alpine Linux on CD

You may have an installation where the boot media being used (such as a CD, for example) is separate from the media used to store the configuration information. In this case, simply download the latest ISO, and replace the boot media contents with the contents of the latest ISO. If you are booting from a CD, this would simply mean replacing the CD with a CD made from the new image and rebooting the Alpine Linux box.

Update remaining packages from Web repository

If you are using APK caching you should also perform the following steps.

Edit the /etc/apk/repositories file using an editor (nano for instance) and if necessary, add references to the Alpine package repositories. In the example below, the file references the Alpine CD, so that if a requested package is available on the local media, it will be obtained from there instead of being downloaded from the remote repository:

Contents of /etc/apk/repositories

/media/cdrom/apks http://dl-3.alpinelinux.org/alpine/v3.3/main

To upgrade, in this example, from version 3.3 to 3.19, simply change:

http://dl-3.alpinelinux.org/alpine/v3.3/main

to

http://dl-3.alpinelinux.org/alpine/v3.19/main

So that the file will look like this:

Contents of /etc/apk/repositories

/media/cdrom/apks http://dl-3.alpinelinux.org/alpine/v3.19/main
Note: Starting with version 3.3, there is a new repository called community. Many packages have been moved from the main repository to the community repository to indicate that they are not guaranteed to be supported beyond six months. If you are using any of these packages, be sure to add the community repository. For example: http://dl-3.alpinelinux.org/alpine/v3.19/community

Above, only one possible repository is shown, however, http://dl-3.alpinelinux.org/alpine/ may also be replaced with any geographically close mirror from: http://rsync.alpinelinux.org/alpine/MIRRORS.txt

Updating package lists

With the correct repositories file in place, the latest index list of available packages can be obtained with:

apk update

Tip: Adding the --update-cache or -U to another apk command, as in apk add -U ... or apk upgrade -U, has the same effect as always running apk update immediately before the other apk command. Instead of auto-update it only if the index has not been updated recently.

If you're upgrading from a version of Alpine before 2.3.0_rc1, ensure you have the latest available version of the Alpine Linux Package Manager first before upgrading anything else:

apk add --upgrade apk-tools

Next, upgrade all your packages:

apk upgrade --available sync

The --available switch is used to force all packages to be upgraded, even if they have the same version numbers. Sometimes changes in uClibc require doing this.

After upgrading packages, save any configuration changes (you should have backed up your earlier configuration prior to upgrading).

lbu ci


Upgrading Alpine Linux on other removable media (such as CF/USB)

The following instructions are for run-from-RAM Alpine installations running on Compact Flash or USB media. Updating your repositories using the procedures detailed above, then running:

apk upgrade --update-cache --available

will suffice for some purposes. (If you want the new packages to be used after a reboot, you should enable APK caching.)

However, this is not an adequate general solution because it won't honor any kernel upgrades and the like. For the general solution, you'll need to upgrade your boot medium (Compact Flash or USB). That is what the following steps describe how to do.

Setup environment variables

To make the documentation a bit more "generic" we start by setting some environment variables.

vi /etc/lbu/lbu.conf

Make sure that the variable LBU_MEDIA is not commented (by removing the leading '#').

You also need to set a appropriate value for your LBU_MEDIA. The media you choose will be the media where you store your settings/configuration.

Note: Even if you have you alpine installed on CF, HD or USB you can still choose to save your config on some other media that suits your needs. But remember that both the media where you have your Alpine system AND the media where you have your config need to be in your box when booting it.

Examples:

LBU_MEDIA=usb

or:

LBU_MEDIA=sda1

Now that you have your /etc/lbu/lbu.conf configured for your needs, we will set the environment variables (note the leading .).

. /etc/lbu/lbu.conf

You can test if your environment variable was set:

echo $LBU_MEDIA

It should output something like usb, sda1, or whatever you just configured.

Back up your config

Before starting to upgrade, it's wise to save your configuration.

lbu ci

Upgrade Operating System

Start by checking that you have enough space on your media. For a standard Alpine image, you need at least 400MB available space.

df -h | grep "Filesystem\|$LBU_MEDIA"

Download and verify new release

Make sure the media that holds your Alpine system is mounted readwrite.

mount -oremount,rw /media/$LBU_MEDIA

If using Alpine Linux 2.2.3 or newer: use the following command to download, mount and copy files as needed for you:

setup-bootable -u {{#latestalp:alpine|url}} /media/$LBU_MEDIA

Once the command completes, proceed to the Save changes section.

For older versions of Alpine

Start downloading a new '.iso' and a '.sha1' file

cd /media/$LBU_MEDIA wget -c {{#latestalp:alpine|url}} wget {{#latestalp:alpine|url}}.sha1

Check integrity of the downloaded files (it might take some time):

sha1sum -c {{#latestalp:alpine|file}}.sha1

The output of the above command should say 'OK'.
If says 'FAILED', delete the iso file and download it again.

If using Alpine Linux 1.10.4 or newer: there is a tool setup-bootable that will mount and copy the image you just downloaded to your boot medium. With this tool simply do:

setup-bootable -u {{#latestalp:alpine|file}} /media/$LBU_MEDIA

Instructions for older versions of Alpine are located elsewhere.

Save changes

Now that all upgrades are done, we should save our settings to our media (which you hopefully have backed up prior to doing this upgrade).

lbu ci

Load new kernel

In most cases you will need to reboot Alpine Linux (especially if there are changes in the kernel):

sync reboot

Note: If you know what you are doing, you might not need to reboot. But make sure that all services affected by the upgrade are restarted.

Update remaining packages from Web repository

If you are using APK caching you should follow the instructions to Update remaining packages from Web repository, above.