Overlayed package doesn't get updated

I noticed that Google Chrome on my wife’s laptop was really old and hadn’t been updated for months. Although a new version appeared in updates and thus rpm-ostree identified there was an updated package, the update was never applied, I always rebooted into an image with the old version.
Today the same happened to my friend with an overlayed MegaSync client.

There were no error messages and the only thing that helped was to uninstall and install the package again.

I wonder if it’s some rare bug or something that has happened to more users and if there is any other solution than just reinstalling the package.

I think this happened to me on an older installation with Chrome overlayed too. I have not investigated this yet (this does not happen with chromium from a repository as far as I know).

This might be related to the fact that the Chrome RPM ships both the RPM repo config and Chrome itself thus rpm-ostree keeps the package in the installed version and can not update it.

One potential workaround would be to extract the RPM repo config from the package and manually add that on the system and then overlay the package via its name without the version, which should allow rpm-ostree to keep it updated.

So the full workaround for this issue is to remove the currently pinned version and install the package in the same rpm-ostree transaction:

$ sudo rpm-ostree uninstall google-chrome-xyz --install google-chrome-stable

If you do not have Google Chrome installed yet, you can add the following repo config in /etc/yum.repos.d/google-chrome.repo and directly install google-chrome-stable: