-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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.
The main utility is the repo's availability check, automatize this operation can save some minute later.
Checking the current repositories can be useful also to detect failures during normal updating procedures:
$ zypper-upgraderepo --check-current
A table with three columns will show the status, the reference number and the name for each repository and in addition, for problematic repositories, also a hint about suggested changes to make to the URL.
The status can be represented by one of these symbols:
- [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.
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 version of openSUSE's repository can be checked:
$ zypper-upgraderepo --check-to 15.0
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/
Before to make any permanent change to the repository's list a backup of them is highly recommended.
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
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 /
The last step before to launch zypper dup
is to overwrite all the repositories with the new address.
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
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!
To summarize this is the list of operations I execute to upgrade my system:
- First of all be sure to update the current version
$ sudo zypper up
- Check for the next repositories
$ zypper-upgraderepo --check-next
- If no error occurred make a backup and upgrade them, otherwise try to fix with the techniques discussed above:
$ zypper-upgraderepo --backup ~ $ sudo zypper-upgraderepo --upgrade
- I prefer to download all the packages first:
$ sudo zypper dup --download-only
- Once all packages are downloaded logout and login to one of the textual sessions availables (i.e. CTRL+ALT+F1), then start the third init level:
# init 3
- Finish the upgrade process:
# zypper --no-refresh dup
- Reboot and you are done!
# reboot now