dotnet --list-sdks sudo rm -rf /usr/share/dotnet/sdk/(.net 9 version)
In my case there's .net 9 installed. I uninstall .net 9 and Archive for Publishing appears again.