Score:2

Can't install specific version of gcc-mingw

cn flag

I need gcc-mingw-w64 version 9.3.0 for a project to compile correctly. I am running hirsute. For this release the gcc-mingw-w64 version is 10.0 something. I already added archive.ubuntu.org focal to my sources.list. But when I run sudo apt update and then sudo apt install gcc-mingw-w64=9.3.0-7ubuntu1+22~exp1ubuntu4 -s the dependant packages are still installed from the hirsute repo:

...
    Inst binutils-mingw-w64-i686 (2.35.1-2ubuntu1+8.11 Ubuntu:21.04/hirsute [amd64])
    Inst mingw-w64-common (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Inst mingw-w64-i686-dev (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Inst gcc-mingw-w64-base (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-i686-posix-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-i686-posix (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-i686-win32-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-i686-win32 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst binutils-mingw-w64-x86-64 (2.35.1-2ubuntu1+8.11 Ubuntu:21.04/hirsute [amd64])
    Inst mingw-w64-x86-64-dev (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Inst gcc-mingw-w64-x86-64-posix-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-x86-64-posix (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-x86-64-win32-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-x86-64-win32 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Inst gcc-mingw-w64-i686 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [all])
    Inst gcc-mingw-w64-x86-64 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [all])
    Inst gcc-mingw-w64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [all])
    Conf binutils-mingw-w64-i686 (2.35.1-2ubuntu1+8.11 Ubuntu:21.04/hirsute [amd64])
    Conf mingw-w64-common (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Conf mingw-w64-i686-dev (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Conf gcc-mingw-w64-base (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-i686-posix-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-i686-posix (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-i686-win32-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-i686-win32 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf binutils-mingw-w64-x86-64 (2.35.1-2ubuntu1+8.11 Ubuntu:21.04/hirsute [amd64])
    Conf mingw-w64-x86-64-dev (8.0.0-1 Ubuntu:21.04/hirsute [all])
    Conf gcc-mingw-w64-x86-64-posix-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-x86-64-posix (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-x86-64-win32-runtime (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-x86-64-win32 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [amd64])
    Conf gcc-mingw-w64-i686 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [all])
    Conf gcc-mingw-w64-x86-64 (10.3.0-1ubuntu1+24.1build1 Ubuntu:21.04/hirsute [all])
    Conf gcc-mingw-w64 (9.3.0-7ubuntu1+22~exp1ubuntu4 Ubuntu:20.04/focal [all])
    zm@pop-os:~$ 

How can I fix this?

Score:0
zw flag

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])
Count_Omega avatar
cn flag
Thanks dude, saved my day.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.