I am using Julia 1.7.3 and PackageCompiler 2.0, I am having exactly the same issue. My OS is CentOS Linux release 7.9.2009. Unfortunately, the above solution does not work for me.
I believe this issue could be related to Error installing artifact dependency, I have tried both the above solutions, but it doesnt work for me. Please help. Thanks