How to upgrade Alpine Linux 3.4 to 3.5.xx

Posted on in Categories , last updated February 5, 2017

I am using Alpine Linux v3.4 with my LXD server. How do I upgrade Alpine Linux v3.4 to Alpine Linux v3.5?

Before you type any one of the following command make sure that you have a backup of your important data before continuing to update your system. It is important that you keep full backup of your system. Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository. Alpine Linux was designed with security in mind. The kernel is patched with an unofficial port of grsecurity/PaX, and all userland binaries are compiled as Position Independent Executables (PIE) with stack smashing protection. These proactive security features prevent exploitation of entire classes of zero-day and other vulnerabilities. When Alpine Linux is installed to hard drive or as LXD VM, upgrading to a newer stable version is straightforward.
Fig.01: Upgrading an Alpine Linux Hard-disk installation
Fig.01: Upgrading an Alpine Linux Hard-disk installation

Find out your Alpine Linux version

Type the following command:
$ cat /etc/alpine-release

How to upgrading to latest release

Edit /etc/apk/repositories file, enter:
# vi /etc/apk/repositories
Change the version number by hand. For example, the default entry for 3.4 is as follows:
To update to 3.5.xx, enter:
Save and close the file. Next grabt the latest index:
# apk update
Sample outputs:

v3.5.1-18-g5a911c1ac9 []
OK: 5660 distinct packages available

To upgrade all your packages, run:
# apk upgrade --available
Sample outputs:

Upgrading critical system libraries and apk-tools:
(1/5) Installing libressl2.4-libcrypto (2.4.4-r0)
(2/5) Installing libressl2.4-libssl (2.4.4-r0)
(3/5) Upgrading apk-tools (2.6.7-r0 -> 2.6.8-r2)
(4/5) Purging libssl1.0 (1.0.2k-r0)
(5/5) Purging libcrypto1.0 (1.0.2k-r0)
Executing busybox-1.24.2-r13.trigger
Continuing the upgrade transaction with new apk-tools:
(1/13) Upgrading musl (1.1.14-r14 -> 1.1.15-r6)
(2/13) Upgrading busybox (1.24.2-r13 -> 1.25.1-r0)
(3/13) Upgrading alpine-baselayout (3.0.3-r0 -> 3.0.4-r0)
Executing alpine-baselayout-3.0.4-r0.pre-upgrade
(4/13) Upgrading openrc (0.21-r3 -> 0.21.7-r4)
(5/13) Upgrading alpine-conf (3.4.1-r5 -> 3.5.0-r2)
(6/13) Replacing zlib (1.2.8-r2 -> 1.2.8-r2)
(7/13) Upgrading busybox-suid (1.24.2-r13 -> 1.25.1-r0)
(8/13) Upgrading busybox-initscripts (3.0-r3 -> 3.0-r8)
(9/13) Replacing scanelf (1.1.6-r0 -> 1.1.6-r0)
(10/13) Upgrading musl-utils (1.1.14-r14 -> 1.1.15-r6)
(11/13) Upgrading libc-utils (0.7-r0 -> 0.7-r1)
(12/13) Upgrading alpine-keys (1.1-r0 -> 1.3-r0)
(13/13) Upgrading alpine-base (3.4.6-r0 -> 3.5.1-r0)
Executing busybox-1.25.1-r0.trigger
OK: 6 MiB in 16 packages

Restart the server/VM container:
# sync
# reboot

Verify it:
$ cat /etc/alpine-release

For more information see

2 comment

  1. RUN echo '' | tee -a /etc/apk/repositories \
    && echo '' | tee -a /etc/apk/repositories \
    && apk upgrade --purge

Leave a Comment