If you install packages from the testing repos and there is a problem what is the urpmi command to revert the packages back to packages in regular repos? First you disable testing repos and then run urpmi ???
Should be --downgrade, I think?
Yes, but not by itself. How do you get urpmi to recognize the installed from testing repo packages that need to be downgraded?
FWIW: This was in Kahinah on this page (or home page) at one time but it’s gone now:
and I foolishly did not seem to copy and paste it anywhere. Can’t believe I didn’t do that.
IIRC I think you have to remove the repo, then do urpmi --downgrade – and
it should automatically pull in the packages that need to be downgraded
(don’t quote me on that - I forget lol)
Oh – I saw you tried that. I have no idea.
No. Run ‘urpmi --downgrade’ and what do you get? Same thing as if you
run ‘urpmi --help’. There has to be something that tells urpmi what
packages to downgrade. It would depend on how you have labeled your
testing repos. It is something like this but as you can see what I have
urpmi --downgrade -a --media main-testing
Try it yourself with how you have labeled your testing repos substituted
For me testing repos are disabled and I’m not testing packages until I
have the command to revert to stable packages.
I there’s going to be a bash script needed top do this. --downgrade only seems to do something (not sure what yet) if you supply it with a package name.
First then we need to get the full package name of everything in testing…You can do that with
urpmq --list --media main_testing -r
Then you can use xargs or parallel to feed urpmi --downgrade something like this.
I’ve distilled the whole thing down to a single command line as it’s easier for me to pass the list of files to parallel as a variable. The --dry-run flag to parallel just shows what would be done.
It’s possible that the user has not installed all the packages in testing because obviously some programs may not be installed so they can’t be updated.
To get around this you’ll note that parallel has a programmable failure threshold which means it will only halt when the number of failures reaches the number specified on the command line.
In addition a log is written to the users home directory.
Here is the full command:-
urpmq --list --media main_testing -r; printf ‘%s\n’ “$DG_LIST” | parallel --dry-run -q --keep-order --joblog $HOME/downgrade.log --tty --halt now,fail=10 -P 1 --verbose /usr/sbin/urpmi --downgrade
This may not be foolproof I will run some testes in a VM. If downgrade doesn’t work then there are other ways to achieve the same result.
Comments and suggestions please.
or a script like this (to be tested and no guarantee):
# list of installed pkgs
rpm -aq > /tmp/list
# list of pkgs with version
DG_LIST=`urpmq --list --media main_testing -r`
# list of pkgs with no version
DG_LIST2=`urpmq --list --media main_testing`
# list of testing pkgs installed
for pkg in $DG_LIST ; do grep $pkg /tmp/list ;[ $? -eq “0” ] && echo $pkg >> /tmp/list2; done
# downgrade: you have to disable testing repos before, but I do not remember how with urpmi
for pkg in $DG_LIST2 ; do grep $pkg /tmp/list2 ;[ $? -eq “0” ] && urpmi --downgrade $pkg; done
postedit: urpmi.update --ignore, --no-ignore mark media as ignored and reverse
I guess I’m giving up on this.
Also currently I’m not going to test packages as I don’t have the time to deal with breakage manually.