Skip to content
Fabio Mucciante edited this page Dec 28, 2018 · 12 revisions

Welcome to the Zypper-Upgraderepo wiki!

Zypper-Upgraderepo checks the current and the next version repositories in the order to provide a smoother upgrade procedure using the zypper dup command.

Beside this main function, it also backup the whole list of repositories and upgrade themselves all at once.

Check repositories

The main utility is the repo's availability check, automatize this operation can save some minute later.

Check the current version repositories

Checking the current repositories can be useful also to detect failures during normal updating procedures:

$ zypper-upgraderepo --check-current

A table with four columns will show:

  • The status for each URL;
  • The number, useful to reference it for further operations;
  • The repository's name as general inf;
  • A hint explaining, when possible, how to fix the failing URL.

The status can be one of these:

  • [V]: Everything works as expected;
  • [W]: The URL has been redirected, the printed URL should be replaced with the printed one;
  • [E]: The URL is invalid, a hint will be printed where possible giving an alternative URL, otherwise is better to find it manually or remove the repository completely if not needed anymore.

Check the next version repositories

Before to upgrade the current system we can check the status of the repository's URLs for the next version, which are interpolated simply replacing the current version of openSUSE with the newer.

$ zypper-upgraderepo --check-next

The table's result will have the same columns seen before.

Last but not least also a custom (valid) version of openSUSE's repository can be checked to jump from a version to another:

$ zypper-upgraderepo --check-to 15.0

Override a repo's URL while checking

As seen before when a repository is not reachable an error status will be print beside the repository itself and where possible a hint will suggest also an alternative.

For testing purpose, it's possible to replace these invalid URLs in the checking chain without overwriting physically the repository's file:

$ zypper-upgraderepo --check-next --override-url 4,http://domain.org/new-path/15.0/

Backup

Before to make any permanent change to the repository's list a backup of them is highly recommended.

The single file backup

Zypper itself allows to backup the list of repositories creating a single file:

$ zypper lr -e ~/backup.repo

And restore the list with:

$ zypper ar ~/backup.repo

The multiple file backup

When, for some reason, you want to make a 1:1 backup of all the repositories installed, the switch --backup may help you:

$ zypper-upgraderepo --backup ~

A tgz file will be placed in the home folder with a squeezed date-time info in the filename.

To restore the list just extract the archive:

$ sudo tar -xvf ~/repos-backup...tgz -C /

Upgrade

The last step before to launch zypper dup is to overwrite all the repositories with the new address.

Upgrade to the next version

Upgrade the repositories to the next versions is as easy as typing:

$ sudo zypper-upgraderepo --upgrade

That helps to save some time instead of changing them one by one with the command zypper mr ....

When a bad URL is detected you can replace it automatically appending one or more --override-url:

$ sudo zypper-upgraderepo --upgrade \
    --override-url 2,http://domain.org/correct/path/15.0/ \
    --override-url 3,http://anotherdomain.org/another-path/15.0

Upgrade to a custom version

Sometimes we need to step up a custom version instead of the next, this is allowed by:

$ sudo zypper-upgraderepo --upgrade-to 15.0

Of course, only existing or existed openSUSE versions will be allowed, don't forget to check the availability of the relative repositories before upgrade!

Other options

  • --only-enabled Check or upgrade only enabled repositories;
  • --report Show the results as a report adding other details;
  • --only-repo [,NUMBER2,...] Check only the repositories specified by their comma-separated number;
  • --sort-by-alias / --sort-by-name / --sort-by-priority Sort the repositories by either alias (default) or name or priority;
  • --timeout Change the waiting time for the answer from the repository server before to raise a timeout error.

Wrap up

To summarize this is the list of operations I execute to upgrade my system:

  1. First of all, if you have unneeded repositories remove or disable them, remove or fix also the wrong repository's URLs using the --check-current operation

    $ zypper-upgraderepo --check-current
    
  2. Be sure to update the system to the latest packages

    $ sudo zypper up
    
  3. If you have a brtfs filesystem check this section: Move /var/cache to a separate subvolume, otherwise go to the next step

  4. Check for the next version repositories

    $ zypper-upgraderepo --check-next
    
  5. If no error occurred then make a backup and upgrade them, otherwise try to fix with the techniques discussed above:

    $ zypper-upgraderepo --backup ~
    $ sudo zypper-upgraderepo --upgrade
    
  6. I prefer to download all the packages first:

    $ sudo zypper dup --download-only
    
  7. Once all packages are downloaded logout from the graphical session and login to one of the textual sessions available (i.e. CTRL+ALT+F1), then start the third init level:

    # init 3
    
  8. Finish the upgrade process:

    # zypper --no-refresh dup
    
  9. Reboot and you are done!

    # reboot now
    

Resources

Clone this wiki locally
You can’t perform that action at this time.