How to reinstall package (with zypper)?

I uninstalled PyQt6 with pip3 uninstall after installing python-311-PyQt6 via zypper install, so I want to ensure that nothing was corrupted, without removing anything dependent upon PyQt6.

man zypper

is your friend.

3 Likes

There are several things (housekeeping) to do before any re-installation is attempted:

 # rpm --rebuilddb
 # zypper verify
 # rpm --verify --all

Once all the indicated issues have been resolved, then –

# zypper install --force «package»

And, please, respect the need to also install all the additional packages required by the package you believe is corrupt.

  • For completeness, you should also forcibly install (re-install) all the packages required by and, the packages which require, the package you suspect is corrupt.
2 Likes

Can I instruct zypper to automatically reinstall all immediate package dependencies?

AFAICS, there’s no Zypper configuration parameter to always use the “install” option –
--force .

           -f, --force
               Install even if the item is already installed (reinstall), downgraded or changes vendor or
               architecture.

I suspect that is a design decision due to, the defined behaviour of the “–force” option.

  • A re-installation of an already installed package is not normally needed – only sometimes …

I’m not sure what you mean by any of that, @dcurtisfra. I’ve been looking at it for a good few weeks now trying to work it out and still haven’t. Could you rephrase that for me?

It’s a feature – not a bug.

  • It is not possible to configure Zypper such that, when the “zypper install” command is executed, the option “–force” is always present.