Installed packages not really installed - How to fix?

I recently performed an upgrade from Leap 42.1 to 42.2. Ever since then, I get errors when I apply updates because zypper thinks packages that aren’t installed really are. Either that or the packages are installed, but zypper thinks they aren’t. An example is libmwaw. I just tried “zypper verify” and got this:

shelby:~ # zypper verify
Loading repository data...
Reading installed packages...

The following package is going to be REMOVED:
  libmwaw-0_3-3

1 package to remove.
After the operation, 6.4 MiB will be freed.
Some of the dependencies of installed packages are broken. In order to fix these dependencies, the following actions need to be taken:
Continue? [y/n/? shows all options] (y): y
(1/1) Removing libmwaw-0_3-3-0.3.8-3.1.x86_64 .................................................................................................................................................................[error]
Removal of (37071)libmwaw-0_3-3-0.3.8-3.1.x86_64(@System) failed:
Error: Subprocess failed. Error: RPM failed: error: package libmwaw-0_3-3-0.3.8-3.1.x86_64 is not installed

How do I fix this?

First, tell us the desktop you are using.

Second, give the output between forum editor CODE tags (# button above the editing window), including the command and full output, of the following:

zypper lr -d

Looks like either zypper’s cache or the rpm database have been corrupted somehow.

Try to run these commands:

sudo rpm --rebuilddb
sudo zypper clean -a

and try again.

That did the trick. Thanks! This was irksome.