The gcc/g++-mingw-w64-x86-64 metapackages pull in both posix and win32 variants, and update-alternatives defaults to win32 whose libstdc++ lacks std::mutex. Install only the posix variants and add an apt retry loop for flaky mirrors.