You are doing in the right direction, but forgot two things - add main pocket for focal and to supply -t=target_release
option to APT.
So complete solution is the following:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ focal main universe"
sudo apt install gcc-mingw-w64=9.3.0-7ubuntu1+22~exp1ubuntu4 -s -t focal
Note: -s
should be removed as we now have correct package origins:
Inst libisl22 (0.22.1-1 Ubuntu:20.04/focal [amd64])
Inst binutils-mingw-w64-i686 (2.34-5ubuntu1+8.8 Ubuntu:20.04/focal [amd64])
Inst binutils-mingw-w64-x86-64 (2.34-5ubuntu1+8.8 Ubuntu:20.04/focal [amd64])
Inst mingw-w64-common (7.0.0-2 Ubuntu:20.04/focal [all])
Inst mingw-w64-i686-dev (7.0.0-2 Ubuntu:20.04/focal [all])
Inst gcc-mingw-w64-base (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Inst gcc-mingw-w64-i686 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Inst mingw-w64-x86-64-dev (7.0.0-2 Ubuntu:20.04/focal [all])
Inst gcc-mingw-w64-x86-64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Inst gcc-mingw-w64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [all])
Conf libisl22 (0.22.1-1 Ubuntu:20.04/focal [amd64])
Conf binutils-mingw-w64-i686 (2.34-5ubuntu1+8.8 Ubuntu:20.04/focal [amd64])
Conf binutils-mingw-w64-x86-64 (2.34-5ubuntu1+8.8 Ubuntu:20.04/focal [amd64])
Conf mingw-w64-common (7.0.0-2 Ubuntu:20.04/focal [all])
Conf mingw-w64-i686-dev (7.0.0-2 Ubuntu:20.04/focal [all])
Conf gcc-mingw-w64-base (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Conf gcc-mingw-w64-i686 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Conf mingw-w64-x86-64-dev (7.0.0-2 Ubuntu:20.04/focal [all])
Conf gcc-mingw-w64-x86-64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [amd64])
Conf gcc-mingw-w64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [all])