Hi Fabio,
thanks for this script. Until now, I performed almost the exact same procedure manually as you did, so I am happy to try out this script!
I ran the script as root, but somehow it fails to access the tmp file. I am now in an infinite loop, as I guess for the same reason (no access) the check-next command does not pickup my edits to the tmp file. See this output:
# zypper upgradedistro
[V] The version Leap 15.4 is available
[?] Do you want to perform an upgrade? [y/N]: y
[V] Selected the last available
[V] System correctly updated
Checking the Repositories... Error! The repository n.1 named fabiomux can't be upgraded, a manual check is required!
[W] Some repository can't get upgraded, so you can...
[*] 1) Disable the repositories having an invalid URL
[*] 2) Try to find a valid URL to replace it
Continue to apply one of these changes to invalid URLs [RETURN]
1
[V] List ready to be edited [RETURN]
/usr/bin/upgradedistro: line 203: /tmp/upgradedistro.2r8u4lGY7ne: Permission denied
Checking repositories again...Error! The repository n.1 named fabiomux doesn't contain the URL key!
[E] Other problems have been detected!
Press the [RETURN] key to edit the file again
/usr/bin/upgradedistro: line 203: /tmp/upgradedistro.2r8u4lGY7ne: Permission denied
Checking repositories again...Error! The repository n.1 named fabiomux doesn't contain the URL key!
[E] Other problems have been detected!
Press the [RETURN] key to edit the file again
/usr/bin/upgradedistro: line 203: /tmp/upgradedistro.2r8u4lGY7ne: Permission denied
Checking repositories again...Error! The repository n.1 named fabiomux doesn't contain the URL key!
[E] Other problems have been detected!
Press the [RETURN] key to edit the file again
In the above scenario, I first selected "1" as input, then I realized I had to edit the tmp file. I edited the tmp file as follows:
[repository_1]
name=fabiomux
alias=fabiomux
old_url=https://download.opensuse.org/repositories/home:/FabioMux/openSUSE_Leap_15.3/
# The interpolated URL is invalid, try overriding with the one suggested
# in the fields below or find it manually starting from the old_url.
# The alternatives are:
# 1. Waiting for a repository upgrade;
# 2. Change the provider for the related installed packages;
# 3. Disable the repository putting the enabled status to 'No'.
#
url=https://download.opensuse.org/repositories/home:/FabioMux/15.4/
priority=99
enabled=Yes
status=Not Found
hint=Override with this one
suggested_url=https://download.opensuse.org/repositories/home:/FabioMux/15.4/
so i simply copy/pasted the suggested_url into the url field.
But this command still fails:
zypper-upgraderepo --check-next --only-enabled --load-overrides "$tmpfile" --ini --only-invalid 1> $tmpfile
I think because it does not pick up my changes, but it does have permission to overwrite the file again!
I also tried disabling the repo in the override file, but same problem.
I wonder if maybe some file handle is not closed or something.. or maybe it already writes something to stdout before the overrides have been loaded.. causing to load an empty override file..?
just thinking out loud here..
still, I can't understand why the script cannot launch the editor on the tmp file. Btw, these are the permissions:
ls -la /tmp/upgradedistro.2r8u4lGY7ne
-rw------- 1 root root 615 4 dec 18:45 /tmp/upgradedistro.2r8u4lGY7ne