如何在没有网络的情况下在 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直接使用;它根本不会查看配置的存储库。

相关内容