Skip to main content

Updating OpenSUSE in-place using zypper dup

What Why When How

  • If you want to upgrade your OpenSUSE while the system is running, you can use 'zypper dup' with these simple 5 steps.
  • After the reboot, the system will be upgraded to the next version.
  • We will be using the command line tool, because it is cool.
  • This guide can be used with all versions from 11.1 and newer.
  • The examples given here are from the upgrade of 11.1 to 11.2
  • A drawback of this method is that your disk will not be converted to use the new ext4 filesystem. For this, do a fresh/clean install

1. Update the system first

Update your current running system with the latest patches. This will ensure that the update process will function correctly and no bugs exist in the rpm/zypper stack. If your system is already patched, continue with the next step If you haven't done so, enable an update repository and bring your system up-2-date.

# zypper addrepo --check --name 'openSUSE-11.1-Update' http://download.opensuse.org/update/11.1/ repo-update
# zypper ref -f && zypper up

After the update a reboot may be required. Make sure this step is successful before proceeding!

2. Delete non standard repos

In this step we need to disable all non-standard OpenSUSE repositories, leaving only the OSS and NON-OSS and an update channel.

# zypper lr -d

Here you will see the repos and their URLs. remove *ALL* the URLS that are not the stanard repos, so remove PackMan, VLC, buildservice repos, google repos, KDE repos, etc etc....

# zypper rr 

replace the number with the number displayed in the first column of the 'zypper lr -d' command In the end you will have just 3 repos: update, OSS and NONOSS.

3. Edit the repos with the new location

Now we will bring the 3 repo's URLs to the desired new version.

# cd /etc/zypp/repos.d/

use vi or your favourite editor to edit the 3 files there.

Modify the line with 'baseurl' to use the new location, so change the 11.1 into 11.2. While you're there, you can also modify the line with 'name' and maybe the first line between the brackets.

When you're done, you should have 3 files representing the 3 new repos.

4. Update the zypper program itself first

Enter the following commands:

# zypper ref -f
# zypper in zypper

5. Do the actual upgrade

We will download all packages locally first, to make sure the upgrade goes smoothly and uninterrupted.

Make sure you have enough space in /var !! Check with

# df -h

and see if the free space on / (or /var) is more then the next command states at the bottom summary, before you give the final go:

# zypper dup -d

Then start the upgrade:

# zypper dup

After this, you can add the repos you had before, like Packman etc. Make sure you add the repos for the new version. Then, do another 'zypper dup', use dup because packages may require a vendor change.