Upgrading Alpine Linux to a new release branch: Difference between revisions

From Alpine Linux
(cleaned up commit to media)
(Alpine starts to be so flexible so various setups are possible - making a menu with various upgrade documents.)
Line 1: Line 1:
= Upgrading Alpine =
= Upgrading Alpine =
Alpine can be booted from various media.<BR>
It has also made some adjustments through time and this could also have impact on how a upgrade could be done.<BR>
These factors makes it hard to make a 'general' upgrade instruction that fits all scenarios.<BR>
The principle is still the same.


This document describes how to replace an Alpine installation with a newer version.
To make your upgrade easy, we now present various documents that will help you in your situation.


The upgrade process consist of the following steps:
== What is your *present* setup ==
* Backup current setup
You need to know...
* Upgrade Alpine CD/USB
* what alpine version the box (that you are upgrading) is running at this moment.<BR>''It does not matter what version you are planning to upgrade to.''
* Execute upgrade script
* what media you are planning to upgrade (on what media is your alpine distro at this moment).<BR>''Choose '''CD''', '''USB''', '''HD/CF''' or whatever fits your setup.''
* Save changes
* Reboot


== Backing up current config ==
Its recommended to make a backup of your config before you start.<BR>
The idea is to save the (*apkovl*) from your media to a safe place.<BR>
If you need to rollback, simply revert to your old *apkovl.tar.gz*.


=== Backing up to media ===
Choose your current setup in the below list
You could replace the existing floppy with a new (dos-formatted) floppy and then run the command:
{|
lbu ci floppy
|'''alpine-1.9.x'''
 
|
Or you could use a USB to store your configuration.
|
lbu ci usb
|
 
|-
== Download new Alpine ==
|'''alpine-1.8.x'''
[http://wiki.alpinelinux.org/w/index.php?title=Downloads Download] latest ISO image (or USB image).
|CD
 
|USB
=== Upgrade CD media ===
|[[Upgrading_Alpine_-_HD_v1.8.x|HD/CF]]
Burn the ISO on a blank CD and replace the existing CD with the new.
|-
/etc/init.d/modloop stop
|'''alpine-1.7.x'''
eject
|
Now you should insert the new media.
|
/etc/init.d/modloop start
|
 
|-
=== Upgrade USB media ===
|'''alpine-1.6.x'''
On USB installations you can just download and unpack the latest tar directly to ''/media/usb''.
|
$ wget -C /media/usb -q -O - \
|
      http://distrib-coffee.ipsl.jussieu.fr/pub/linux/alpine/alpine/v1.7/usbdrive/alpine-1.7.22-i386.tar.gz \
|
      | tar -zvx
|-
 
! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
== Execute upgrade script ==
! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
The new media has a ''upgrade'' script found on root level on media (/media/cdrom/upgrade or /media/usb/upgrade).<BR>
! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Start by executing this script (in our example below we use CD media).
! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/media/cdrom/upgrade
|}
 
=== Example on how a upgrade could look ===
Before actually upgrading packages it will get an overview what packages will be upgraded.<BR>
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)
busybox-1.5.0-r1                    <  needs updating (index has 1.7.1)
 
Press Enter to continue or Ctrl-c to abort.
</pre>
 
Verify that it looks ok and press [''enter''] to start the upgrade.
 
As a first step the upgrade script will try to upgrade apk-tools, uclibc and busybox.<BR>
Then it will upgrade all packages by running'' 'apk_add -u'''.<BR>
It will look something like this:
<pre>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
</pre>
 
When then'' 'apk_add' ''application upgrades packages, it will detect that you have modified some config files.<BR>
Instead of overwriting your config, it will install the new config with the suffix'' '.apk-new'''.<BR>
This way you are able to review and merge in changes from the default config to your own config file.<BR>
Config files that are untouched will just silently be replaced.
 
The'' 'upgrade' ''script will execute'' 'update-conf' ''to assist you in merging the config files.<BR>
It will first display a list of config files that you will need to take care of manually.<BR>
Like this:
<pre>The following config files have been updated and need attention:
/etc/profile
/etc/modules
/etc/inittab
/etc/hosts
/etc/init.d/syslog
/etc/init.d/networking
/etc/init.d/modloop
</pre>
 
Afterward it will step through every file, displaying a diff and give you options to act:
<pre>
--- /etc/profile        2007-05-31 14:11:47 +0000
+++ /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'''.<BR>
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.
Next is file is'' '/etc/modules''':
<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.
 
Next file is'' '/etc/inittab''':
<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.<BR>
This is even related to where the login screen should appear so if we dont merge this change, we might not be able to see the login screen!<BR>
We choose'' 'u' ''to use the new config.
 
Continue go through every config file.<BR>
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'''.<BR>
You can always resume later by either running the'' 'upgrade' ''script again or by executing'' 'update-conf -i'''.
 
== Save changes ==
Now that all upgrades are done, we should save our settings to our media (which you hopefully have backed up).
lbu ci floppy
 
== Rebooting ==
In most cases you will need to reboot Alpine (specially if there are changes in the kernel):
kill 1
'''''Note:''' If you know what you are doing, you might not need to reboot.<BR>But make sure that all services affected by the upgrade are restarted.''

Revision as of 13:30, 10 February 2009

Upgrading Alpine

Alpine can be booted from various media.
It has also made some adjustments through time and this could also have impact on how a upgrade could be done.
These factors makes it hard to make a 'general' upgrade instruction that fits all scenarios.
The principle is still the same.

To make your upgrade easy, we now present various documents that will help you in your situation.

What is your *present* setup

You need to know...

  • what alpine version the box (that you are upgrading) is running at this moment.
    It does not matter what version you are planning to upgrade to.
  • what media you are planning to upgrade (on what media is your alpine distro at this moment).
    Choose CD, USB, HD/CF or whatever fits your setup.


Choose your current setup in the below list

alpine-1.9.x
alpine-1.8.x CD USB HD/CF
alpine-1.7.x
alpine-1.6.x