Include:Upgrading to Edge: Difference between revisions

From Alpine Linux
(Fix repo switch with sed (broken on v3.10))
No edit summary
 
(13 intermediate revisions by 6 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.)


To begin, you need to update your {{Path|/etc/apk/repositories}} file. Here are some shortcuts for doing so:
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]].  
:* 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/v&#91;&#91;:digit:&#93;&#93;\..*\//edge\//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}}


<!--
The crucial difference is, that 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>.
After updating the repositories file, obtain the latest index (and available packages, if you've [[Local APK cache|enabled APK caching]]):
{{Cmd|apk update --update-cache}}


Next, ensure you have the latest available version of the Alpine Linux Package Manager first before upgrading anything else:
When using edge branch, '''testing''' repository can be added if the packages that one needs are available only in '''testing''' repository.
{{Cmd|apk add --upgrade apk-tools}}
{{Note|Remember that, packages in [[Repositories#Testing|testing]] repository have no support.}}
-->


Next, upgrade all your packages in one shot: {{Cmd|apk upgrade --update-cache --available}}
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.


{{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:
{{cat|/etc/apk/repositories|#/media/cdrom/apks
{{Cmd|sync
http://dl-cdn.alpinelinux.org/alpine/edge/main
reboot}}
http://dl-cdn.alpinelinux.org/alpine/edge/community
http://dl-cdn.alpinelinux.org/alpine/edge/testing
}}
}}


To check your current release: {{Cmd|cat /etc/alpine-release}} You will see the build date attached to the release.
After upgrading to edge, the currently installed edge version may be checked with {{Cmd|$ cat /etc/alpine-release}} and referring to the build date that is attached to the release.
 
{{Warning|Do not enable stable and edge repos at the same time. This can break your system. Either use edge '''or''' stable. If you mix stable and edge repositories, you're on your own.}}


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

Latest revision as of 18:19, 5 September 2024

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.2 or latest-stable) therein need to be pointing to edge.

When using edge branch, testing repository can be added if the packages that one needs are available only in testing repository.

Note: Remember that, packages in testing repository have no support.


Contents of /etc/apk/repositories

#/media/cdrom/apks http://dl-cdn.alpinelinux.org/alpine/edge/main http://dl-cdn.alpinelinux.org/alpine/edge/community http://dl-cdn.alpinelinux.org/alpine/edge/testing

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.

Warning: Do not enable stable and edge repos at the same time. This can break your system. Either use edge or stable. If you mix stable and edge repositories, you're on your own.