CentOS 7 - yum 安装不起作用

Kun*_*nok 15 yum centos

每当我想使用命令时,yum install <packagename>我都会收到错误消息:

没有可用的包

例如,

[root@cpanel1 etc]# yum install autossh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.t-2.net
 * extras: centos.t-2.net
 * updates: centos.t-2.net
No package autossh available.
Error: Nothing to do
[root@cpanel1 etc]# 
Run Code Online (Sandbox Code Playgroud)

我如何使它工作?

Rah*_*hul 20

这些步骤可能对你有帮助

  1. yum clean all & yum clean metadata

  2. 签入文件/etc/yum.repos.d并确保它们不是enabled = 0每个 repo都有的(每个文件可能不止一个)。

  3. 最后,您将能够yum update搜索所需的软件包。


小智 8

对于 CentOS/RHEL 7,Repoforge 存储库中不再提供 autossh。所以你需要从源代码构建和编译它,这是你应该做的:

$ sudo yum install wget gcc make
$ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz
$ tar -xf autossh-1.4e.tgz
$ cd autossh-1.4e
$ ./configure
$ make
$ sudo make install
Run Code Online (Sandbox Code Playgroud)

  • 不要从源代码构建它。autossh.el7 在 EPEL 中。使用 `yum` 从那里安装它。 (3认同)

Sub*_*ire 5

首先安装EPEL(Extra Packages for Enterprise Linux),然后安装你需要的包名

$ yum -y install epel-release
$ yum -y install autossh
Run Code Online (Sandbox Code Playgroud)