Include:Upgrading to Edge: Difference between revisions

From Alpine Linux
(update)
(Added "/usr merge" instructions)
 
(25 intermediate revisions by 8 users not shown)
Line 1: Line 1:
An upgrade of Alpine Linux from a stable version to the rolling development version, ''edge'' can be done in a few simple steps. (These instructions assume that Alpine Linux is installed to a hard drive, rather than run-from-RAM.)
An upgrade of Alpine Linux from a stable version to the rolling development version ''edge'' basically requires the same steps as [[Upgrading_Alpine#Upgrading_to_latest_release|Upgrading to latest release]].  


To begin, you need to update your {{Path|/etc/apk/repositories}} file. Here are some shortcuts for doing so:
There are only two differences:-
:* Launch {{Cmd|setup-apkrepos}} Enter {{Key|e}} to edit {{Path|/etc/apk/repositories}}. Change the version number (such as <var>v3.2</var>) to '''edge'''.
:* Or, edit the file in place: {{Cmd|sed -i -e 's/<var>v3\.2</var>/<var>edge</var>/g' /etc/apk/repositories}}
  <!--
  cat /etc/alpine-release | cut -c 0-3
  This is not working at the moment
  cat /etc/alpine-release | cut -c 0-3 | sed -i -e 's/v{}/edge/g' /etc/apk/repositories
  -->
The result should look like this:
{{Cat|/etc/apk/repositories|...
http://dl-3.alpinelinux.org/alpine/edge/main}}


<!--
* When editing the {{Path|/etc/apk/repositories}} file, all referenced repository versions (such as {{ic|v{{#expr:{{AlpineLatest}}}}}} or {{ic|latest-stable}}) therein need to be pointing to <code>'''edge'''</code> as follows. {{cat|/etc/apk/repositories|#/media/cdrom/apks
After updating the repositories file, obtain the latest index (and available packages, if you've [[Local APK cache|enabled APK caching]]):
http://dl-cdn.alpinelinux.org/alpine/edge/main
{{Cmd|apk update --update-cache}}
http://dl-cdn.alpinelinux.org/alpine/edge/community
@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing}}
* When the upgrade completes, ''edge'' currently issues an encouragement to run a ''"/usr merge"'' script that would update the base filesystem hierarchy:
<pre>
usr_merge_nag.sh:
* WARNING: The current system is not /usr-merged. You are encouraged to
* migrate manually to ensure the best-possible support. See
* https://alpinelinux.org/posts/2025-10-01-usr-merge.html for more details
</pre>
:Applying this change should not affect general users.  For background  information on this process, consult the [https://alpinelinux.org/posts/2025-10-01-usr-merge.html news release], including its listing of the types of installations that may be affected.
:This update is not currently a requirement but will be implemented in the future. 
:To attempt its implementation with a dry run first that should foresee errors in execution:
<pre>
# As per a standard system upgrade to Edge or to a new release
doas apk upgrade -aU   


Next, ensure you have the latest available version of the Alpine Linux Package Manager first before upgrading anything else:
# Install the script
{{Cmd|apk add --upgrade apk-tools}}
doas apk add merge-usr
-->


Next, upgrade all your packages in one shot: {{Cmd|apk upgrade --update-cache --available}}
# Simulate the outcome of the merge: do a "dry run".  This would report any errors onscreen
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 musl-libc have required doing this.
doas merge-usr --dryrun


{{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:
# If any error is reported, it would be appreciated if you could kindly open an issue at https://gitlab.alpinelinux.org/alpine/aports/–/issues/new
{{Cmd|sync
reboot}}
}}


To check your current release: {{Cmd|cat /etc/alpine-release}} You will see the build date attached to the release.
# WARNING: The next step would be to run the script, but it is only to be run as long as the steps above were performed without any errors
doas merge-usr


[[Category:Package Manager]]
# The script would no longer be required and may now be deleted from the system
[[Category:Installation]]
doas apk del merge-usr
[[Category:Development]]
 
# Remember to sync and reboot, as per usual after a system upgrade
doas sync
doas reboot
</pre>

Latest revision as of 17:41, 8 October 2025

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.

There are only two differences:-

  • When editing the /etc/apk/repositories file, all referenced repository versions (such as v3.22 or latest-stable) therein need to be pointing to edge as follows.

    Contents of /etc/apk/repositories

    #/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
  • When the upgrade completes, edge currently issues an encouragement to run a "/usr merge" script that would update the base filesystem hierarchy:
usr_merge_nag.sh: 
* WARNING: The current system is not /usr-merged. You are encouraged to
* migrate manually to ensure the best-possible support. See
* https://alpinelinux.org/posts/2025-10-01-usr-merge.html for more details
Applying this change should not affect general users. For background information on this process, consult the news release, including its listing of the types of installations that may be affected.
This update is not currently a requirement but will be implemented in the future.
To attempt its implementation with a dry run first that should foresee errors in execution:
# As per a standard system upgrade to Edge or to a new release
doas apk upgrade -aU    

# Install the script
doas apk add merge-usr

# Simulate the outcome of the merge: do a "dry run".  This would report any errors onscreen
doas merge-usr --dryrun

# If any error is reported, it would be appreciated if you could kindly open an issue at https://gitlab.alpinelinux.org/alpine/aports/–/issues/new 

# WARNING: The next step would be to run the script, but it is only to be run as long as the steps above were performed without any errors
doas merge-usr

# The script would no longer be required and may now be deleted from the system
doas apk del merge-usr

# Remember to sync and reboot, as per usual after a system upgrade
doas sync
doas reboot