windows使用scoop安装gcc报404错误的解决方法

原因:

这是由于scoop默认bucket里面gcc相关源出错导致的。

解决方法

参阅github scoop issue

scoop安装目录找到.\buckets\main\bucket\gcc.json

编辑gcc.json,将下列文本覆盖原有的。

{
    
    
    "version": "9.3.0-2",
    "description": "GNU Compiler Collection (Mingw-w64 port from MSYS2 project)",
    "homepage": "http://mingw-w64.org/doku.php",
    "license": "GPL-3.0-or-later,ZPL-2.1,...",
    "architecture": {
    
    
        "64bit": {
    
    
            "url": [
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.35.1-3-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5815.9517d302-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-expat-2.2.10-1-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-9.3.0-2-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-9.3.0-2-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-9.3.0-2-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-9.3.0-2-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gettext-0.19.8.1-10-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5815.9517d302-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-isl-0.22.1-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-2-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5814.9dbf4cc1-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-make-4.3-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.0.2-2-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-pkg-config-0.29.2-3-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-9.0.0.6090.ad98746a-1-any.pkg.tar.zst",
                "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-9-any.pkg.tar.zst"
            ],
            "hash": [
                "f4cc0f272bfc6232a94f6ec6e6a59dabfcc9804a0063d107fd0ef605544db086",
                "b2c79727807bf1c13881dbc5cc49617105e317cfff8a4e946d420163048fccb5",
                "50cd229f8aed5ed4b0a066715a17d028f2898571975b24ac08dda70e8ad1d0bb",
                "29ccb0030d1dae9fd194bb5bc76ba7330a7478b0afe1b2c0c19419a59c0980ef",
                "228f8cb9ef89806fd96aba00d814d1f038e7ef84e5926730b427d79b5f225b73",
                "c88596218c06622ee22df85bbd2f5b7e6fb99ea86f946d5f98f9c24b97f92dd0",
                "596749645071942369ce93266f7622d64d53daf1cd509ca3b86782add9ef714a",
                "2fa2067672b22269ee8bdc4485b27537057adac3ed4d6d2db0043763f01e0816",
                "5cb1a3b31c95cfb0c9dafa93b2898479ac660e5ac931be54f7dddc8e726f98d0",
                "cbe0b0a1af6c46ff2bf3f4cc8f96e73c862a2b11781bd21d6e10cbb4fba587da",
                "202d28c4d0eeb38837afa39c157c3c1c046ae313641e1a348e1ff60787d447da",
                "44d1f338012a8f503eb31ad8941129df09d3d6307f688f30d612eef3b17a285b",
                "35d49b330e55c347644e4c0a8d8ce0886ae6b005c0ab1b0bb28bbcf563754704",
                "7863472b0763a1a6ca70bdcc6e98df3b2016b221c9da5fe264b28d1c6e1c236c",
                "d7c59f4e347a86e1cf1c539277fd3e43096846642b1cdf764cae1a8a4e783374",
                "322712f92173473913b3199988301c3b32639289a4410ba31e732e54bacf3143",
                "867c946174c2a2db9f7836edf68aa317c8453b1417ff7851d994f99015e7a9a5",
                "6c0ea4adcef503dc8174e9d4d70a10aee8295d620db4494f78fa512df0589dcf",
                "aa20b2dac9d4286d20a890200cab9a204a5236f69d9e83c0711273ece2553a6a",
                "9da9ebafaef832dba2f442ad44d9ae8759784b86478dcbe326500195f8ea6339"
            ],
            "pre_install": [
                "Move-Item \"$dir\\mingw64\\*\" \"$dir\"",
                "Remove-Item \"$dir\\mingw64\", \"$dir\\.*\""
            ],
            "post_install": [
                "ensure \"$dir\\bin\\bak\" | Out-Null",
                "Move-Item \"$dir\\bin\\python*.exe\" \"$dir\\bin\\bak\""
            ]
        },
        "32bit": {
    
    
            "url": [
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-binutils-2.34-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-crt-git-8.0.0.5815.9517d302-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-expat-2.2.9-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-9.3.0-2-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-9.3.0-2-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libgfortran-9.3.0-2-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-9.3.0-2-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-8-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-headers-git-8.0.0.5815.9517d302-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-isl-0.22.1-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5814.9dbf4cc1-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-make-4.3-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.0.2-2-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-winpthreads-git-8.0.0.5814.9dbf4cc1-1-any.pkg.tar.xz",
                "http://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz"
            ],
            "hash": [
                "234396201fb4078ef8463497c04151c7826f0313dcb4b40c9b82aea3a282e819",
                "15809600cdd409e83b75e9a937c6c32c5b81b236f394f1880800785cf7fa08ca",
                "37dfa72246fd2478b991c93b5cce930b872420d6785fe7605458b472472134d8",
                "2b0cb084cec8dcd63f893901007be3f70e3584e44a9f4f9dbb381905a4105d5e",
                "3751e3f3878e979b9b49346ad3105499d6ca2da737db6bfb35663ac72c514f3d",
                "66ee1a681d31b581c0450d57b06aa8e4f2ee6ce5a63db53041884f0b498d7f25",
                "01b5f6e44b10be52a926b651a75d5d8137dafc27550915c24818023039ab1985",
                "c1b3f4ea1a5c71b944bd0a71d2c2f6a36c38a5762a2b193bc4facf75c33d9c7a",
                "3bf4783aed8e705fe9be132feced44d7097180d825367bc2b46fe45c39d2b701",
                "d0b9419f8a1d858d99feaa7447a0ad28e48328a978ce8269ece612abc08dae8b",
                "7e6f75306aec44e3351aa1ae0adb9eed892d99dd552d564a903e9200474a0599",
                "bbd79d5059f116e8f4b8dd26ca661f384eee1082b265389dbfa364d316eea334",
                "df7d70010f7e1443ede50887430352ddf15787cf6d8cb39bec2f4f36a3d5e5c5",
                "49a9bd81fe265fd969618f9ffee9926a92193cc86d409cb1988f35a4dad3fe79",
                "599a0276820e3d342d1c494c4506aaf79fbbbc2843bbec7aae5f22a1b71da284",
                "7ba5ed9c5e535fdc619138278fff0567dad39b9251d5dc5c4d708ab6f345146e",
                "39e07e61d739ba8f066605a109a19db397be6f7ddd81e5172f49ed253fdbe49f",
                "56323bc39c7de0ff727915c09c4aaa25b8396efc0d7eda0006d5951bb6a6b983",
                "554d832117312bdbfbb3840046916670625fa1383d16b25e76941285ff5bc933",
                "addf6c52134027407640f1cbdf4efc5b64430f3a286cb4e4c4f5dbb44ce55a42"
            ],
            "pre_install": [
                "Move-Item \"$dir\\mingw32\\*\" \"$dir\"",
                "Remove-Item \"$dir\\mingw32\", \"$dir\\.*\""
            ],
            "post_install": [
                "ensure \"$dir\\bin\\bak\" | Out-Null",
                "Move-Item \"$dir\\bin\\python*.exe\" \"$dir\\bin\\bak\""
            ]
        }
    },
    "bin": [
        [
            "bin\\mingw32-make.exe",
            "make"
        ]
    ],
    "env_add_path": "bin"
}

再次scoop install gcc

可以成功安装,问题解决

猜你喜欢

转载自blog.csdn.net/a914541185/article/details/119873855