Arch Linux - How to Fix "Invalid or corrupted package"

I was trying to upgrade my arch linux package and encountered the following error :

error: failed to commit transaction (invalid or corrupted package)

After a quick google research I have found that there are new keys in the archlinux-keyring and after updating it the problem was fixed.

pacman -S archlinux-keyring