如何在沒有網路的情況下在 RH 7 上安裝 MinGW?

如何在沒有網路的情況下在 RH 7 上安裝 MinGW?

我正在嘗試在 Linux Red Hat 7 電腦上安裝 MinGW。不幸的是,出於安全原因,我在那台機器上沒有互聯網,儘管我可以複製文件。

這個問題告訴我EPEL 7應該有MinGw。 在哪裡可以找到並安裝 centos-7 的 mingw-w64 軟體包?

所以我能夠按照此處的說明安裝 EPEL 7:https://fedoraproject.org/wiki/EPEL 但是我確實必須手動下載 epel-release-latest-7.noarch.rpm 包,然後運行yum install <my local epel 7>

然而,然後我陷入困境。我嘗試sudo yum install mingw64-gcc,並收到一條以以下結尾的長錯誤訊息:

 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

因此,我嘗試了sudo yum install mingw64-gcc --disablerepo=x86_64sudo yum install mingw64-gcc --disablerepo=epel/x86_64,正如錯誤訊息所示,並且兩次都收到相同的訊息。

此時,我懷疑問題是 yum 找不到 EPEL 軟體包,因為我沒有互聯網,因此我失敗了。

我也嘗試過,sudo yum --enablerepo=extras install epel-release因為在一些帖子中建議這樣做,但也失敗了。我不知道這是什麼,但我懷疑只是安裝了 EPEL 7,我已經完成了。

問題:

  1. 我下載的 epel-release-latest-7.noarch.rpm 軟體包中是否包含像 MinGw 這樣的 EPEL 軟體包?或者sudo yum install mingw64-gcc命令是否轉到某個 URL 並嘗試從那裡獲取 mingw?
  2. 如果sudo yum install mingw64-gcc嘗試從互聯網上的其他位置獲取 MinGw 信息,有沒有辦法可以像使用 EPEL 7 那樣下載並複製它?
  3. 最後,我嘗試安裝 minGw 似乎失敗了,因為 EPEL 7 無法獲取其他一些軟體包的信息,我認為這些軟體包與 MinGw (x86) 無關。但這只是一個猜測。如果是這樣,我可以告訴 yum 停止尋找 mingw 以外的所有其他儲存庫嗎?

最後,我真的只是想在沒有網路的情況下在我的 RH 7 上安裝 MinGw,所以如果有人有其他方法可以做到這一點,我會很高興。

答案1

  1. 您安裝的檔案會告訴 YUM 有關 EPEL 儲存庫的信息,但它不會傳送其中包含的任何資料;這些包是從互聯網上的各種鏡像中檢索到的。你可以在這裡查看包

  2. 是的,您可以手動下載軟體包。但是,據我所知,EPEL 7 中不再提供 MinGW-w64 軟體包...

  3. 一旦您安裝了 RPM,您應該使用yum installRPM 的名稱,而不是一般的軟體包名稱。也可以rpm -i直接使用;它根本不會查看配置的儲存庫。

相關內容