-
-
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.
Besides 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 four columns will show:
- The status for each URL;
- The number, useful to reference it for further operations;
- The repository's name;
- A hint explaining, when possible, how to replace the invalid 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.
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
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
From the 1.3.0 version, there is a new ini view which can be used to export the actual situation, fix the list of URLs where needed through our comfortable text editor, and finally upgrade the system using the elaborated file.
$ zypper --check-next --ini > ~/output-check.ini
$ kwrite ~/output-check.ini
$ zypper --upgrade-from-file ~/output-check.ini
While using the ini file we will get a list of repositories where, among all the other informations, the OldURL key keeps the original URL, and the URL key the newer that will perform the upgrade.
Below an example about a valid upgrade:
[Repository_1]
Name=Packman_Leap_15.2
Alias=Packman_Leap_15.2
URL=http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.2/
OldURL=http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.1/
Priority=99
Enabled=Yes
Status=Ok
When the URL can't be interpolate or just needs a confirmation, that key won't be added automatically, but requires a manual intervention:
[Repository_5]
Name=Hardware tools (openSUSE_Leap_15.2)
Alias=hardware
OldURL=http://download.opensuse.org/repositories/hardware/openSUSE_Leap_15.1/
Priority=99
Enabled=Yes
Status=Not Found
Hint=Can't find a valid alternative, try manually!
Overriding an URL will discard any validity check against the version we want to obtain, so be careful while using this feature.
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!
- --only-enabled Check or upgrade only enabled repositories;
- --ini Export the checking result as ini file which can be used later;
- --quiet Show only an error message when something wrong happen;
- --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.
To summarize this is the list of operations I execute to upgrade my system:
-
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
-
Be sure to update the system to the latest packages
$ sudo zypper up
-
If you have a
brtfs
filesystem check this section: Move /var/cache to a separate subvolume, otherwise go to the next step -
Check for the next version repositories
$ zypper-upgraderepo --check-next
-
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
-
I prefer to download all the packages first:
$ sudo zypper dup --download-only
-
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
-
Finish the upgrade process:
# zypper --no-refresh dup
-
Reboot and you are done!
# reboot now
- zypper-upgraderepo-plugin use this gem as zypper subcommand
- Small tutorial on openSUSE Lizards
- My tutorial translated in spanish by openSUSE Mexico team
- My tutorial translated in greek by Efstathios Iosifidis
- News on zypper-upgraderepo 1.2
- Upgrading openSUSE with zypper