命令结果

命令结果

我有一台安装了 Red Hat Enterprise Linux AS 版本 4(Nahant 更新 3)的服务器。我尝试使用此链接添加在线存储库:

Centos 维基:RPMForge

一切都很顺利。但是当我尝试安装任何软件包时,它会回复:

[root@Backup yum.repos.d]# yum -v install httpd
-bash: yum: command not found

有一些存储库/etc/yum.repo.d/

mirrors-rpmforge  mirrors-rpmforge-extras  mirrors-rpmforge-testing  rpmforge.repo

其内容rpmforge.repo为:

[root@Backup yum.repos.d]# cat rpmforge.repo
### Name: RPMforge RPM Repository for RHEL 4 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el4/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el4/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el4/en/$basearch/testing
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

命令结果

[root@Backup yum.repos.d]# yum
-bash: yum: command not found
[root@Backup yum.repos.d]# which yum
/usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)
[root@Backup yum.repos.d]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@Backup yum.repos.d]# rpm -q yum
package yum is not installed
[root@Backup yum.repos.d]# find /bin/ /usr/bin -name yum
[root@Backup yum.repos.d]# find /bin/ /usr/bin -name yum*
[root@Backup yum.repos.d]# ls -l /etc/yum.comf
ls: /etc/yum.comf: No such file or directory
[root@Backup yum.repos.d]# ls -l /etc/yum.conf
ls: /etc/yum.conf: No such file or directory

答案1

经过简单检查后,我在回答评论中询问了您:

[root@Backup yum.repos.d]# yum
-bash: yum: command not found
[root@Backup yum.repos.d]# which yum
/usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)
[root@Backup yum.repos.d]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@Backup yum.repos.d]# rpm -q yum
package yum is not installed

我们可以验证您的系统中没有安装 yum。

请通过安装它rpm,您就可以启动它。

答案2

  1. pkgs.org
  2. 找到适合您的 rhel 版本和架构(x86 或 x86_64)的 yum rpm 软件包。
  3. 下载rpm包。
  4. su -c 'rpm -i ~/Downloads/*.rpm使用图形包管理器安装。

答案3

他们的yum包在RHEL4中默认是不安装的,因为它是后来出现的。您可以安装它或使用 up2date 命令安装软件。

相关内容