简体   繁体   English

yum install 只显示“Loaded plugins:fastestmirror, langpacks”然后退出安装

[英]yum install only displays "Loaded plugins: fastestmirror, langpacks" then exits the installation

When I execute a command to install a package, all that I get is the following message: “Loaded plugins: fastestmirror, langpacks”.当我执行命令安装 package 时,我得到的只是以下消息:“加载的插件:fastestmirror,langpacks”。 Then the installation is exited, and I see a command prompt.然后退出安装,我看到一个命令提示符。 For example, I want to install the libgit2-devel package, and so I execute the following line: sudo yum -disablerepo=”*” –enablerepo=R-packages install libgit2-devel .例如,我想安装 libgit2-devel package,所以我执行以下行: sudo yum -disablerepo=”*” –enablerepo=R-packages install libgit2-devel

Before that, I put all the.rpm files in a folder: “/R/linux”.在此之前,我将所有.rpm 文件放在一个文件夹中:“/R/linux”。 Then I created a repository with the following command: createrepo --database /R/linux .然后我使用以下命令创建了一个存储库: createrepo --database /R/linux Then I created a repo file: “/etc/yum.repos.d/R-packages.repo”.然后我创建了一个 repo 文件:“/etc/yum.repos.d/R-packages.repo”。 The repo file I created looked as follows:我创建的 repo 文件如下所示:

[R-packages]
name= R-packages
baseurl=file:///R/linux
enabled=1
gpgcheck=0

Once I did that, package installations were going just fine.一旦我这样做了,package 安装就很好了。 One of the packages I installed was devtoolset-11, because updated C++ compilers are needed to install some R packages.我安装的软件包之一是 devtoolset-11,因为安装一些 R 软件包需要更新的 C++ 编译器。 I then enabled devtoolset-11 by executing the following command: scl enable devtoolset-11 bash .然后我通过执行以下命令启用了 devtoolset-11: scl enable devtoolset-11 bash The installations stopped working after this point.此后安装停止工作。 But even after I disabled devtoolset-11 ( scl disable devtoolset-11 bash ), the installations still wouldn't work.但即使我禁用了 devtoolset-11( scl disable devtoolset-11 bash ),安装仍然无法正常工作。

There are some other posts about getting hung up after the “Loaded plugins: fastestmirror, langpacks” message.在“Loaded plugins:fastestmirror, langpacks”消息之后,还有一些关于挂断的帖子。 I should be clear that I am seeing that message followed quickly by another command line prompt.我应该清楚的是,我看到该消息后紧跟着另一个命令行提示符。 There is no hanging.没有悬挂。

I'm working on the following system, which is offline/air-gapped : "CentOS Linux release 7.8.2003 (Core)"我正在开发以下离线/气隙系统:“CentOS Linux 版本 7.8.2003(核心)”

There are suggestions in some forums that involve removing files, etc., and I'm hesitant to do any of that.一些论坛中有一些涉及删除文件等的建议,我很犹豫要不要这样做。 As my knowledge of Linux systems is very limited, I want to make sure I don't do something to really mess up the system, if I haven't done so already.由于我对 Linux 系统的了解非常有限,如果我还没有这样做的话,我想确保我不会做一些真正搞砸系统的事情。 Any troubleshooting advice, however, is appreciated.但是,任何故障排除建议都值得赞赏。

Also, here's what I see when executing code with the --verbose option.此外,这是我在使用--verbose选项执行代码时看到的内容。

$ sudo yum --verbose disablerepo="*" –enablerepo=R-packages install libgit2-devel
Loading "fastestmirror" plugin
Loading "langpacks" plugin
Adding en_US.UTF-8 to language list
Config time 0.011
Yum version: 3.4.3
$ 

It turns out that I need to be "root".事实证明,我需要成为“root”。 So, how do you become root?那么,如何成为root呢? Execute the following code at the command prompt: sudo su .在命令提示符处执行以下代码: sudo su Once you do this, you'll see something change at the command prompt, like the following: [root@system-name user-name]# .执行此操作后,您会在命令提示符处看到一些变化,如下所示: [root@system-name user-name]#

After becoming root, you don't need the sudo prefix anymore to do installations:成为 root 后,您不再需要sudo前缀来进行安装:

yum --verbose disablerepo="*" –enablerepo=R-packages install libgit2-devel

One more thing, scl enable appears to be quite temporary.还有一件事, scl enable似乎是暂时的。 A better solution is to add the path of updated compilers to the.bash_profile.更好的解决方案是将更新编译器的路径添加到 .bash_profile。 In my case, I made the following edit with nano.bash_profile :就我而言,我使用nano.bash_profile进行了以下编辑:

PATH=/opt/rh/devtoolset-11/root/bin:$PATH

export PATH

Then execute the change with source.bash_profile and check the change with gcc --version .然后使用 source.bash_profile 执行更改并使用source.bash_profile gcc --version检查更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM