11

I have one server with Red Hat Enterprise Linux AS release 4 (Nahant Update 3) installed. And I tried to add the online repo using this link:

Centos Wiki: RPMForge

And everything goes smooth. But when I tried to install any package it replies:

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

There are some repos in /etc/yum.repo.d/:

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

The content of rpmforge.repo is:

[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

Command Results

[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
OmiPenguin
  • 4,168
  • 34
  • 79
  • 111

3 Answers3

9

After simple checks I've asked you in answer comment:

[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

we can verify that you don't have yum installed in your system.

Please install it via rpm and you'll be able to launch it.

rush
  • 27,055
  • 7
  • 87
  • 112
  • Why this happen ? `[root@cpanel1 ~]# passwd -bash: passwd: command not found [root@cpanel1 ~]# passwd -bash: passwd: command not found [root@cpanel1 ~]# yum update -bash: yum: command not found [root@cpanel1 ~]# type yum -bash: type: yum: not found [root@cpanel1 ~]# which yum /usr/bin/which: no yum in (:/root/bin) [root@cpanel1 ~]# echo $PATH :/root/bin [root@cpanel1 ~]# rpm -q yum -bash: rpm: command not found [root@cpanel1 ~]# find /bin /usr/bin -name yum -bash: find: command not found [root@cpanel1 ~]#` – Chaminda Bandara May 02 '20 at 08:19
2
  1. Go to pkgs.org.
  2. Find the yum rpm package for your rhel version and architecture (x86 or x86_64).
  3. Download the rpm package.
  4. Install with su -c 'rpm -i ~/Downloads/*.rpm or with your graphical package manager.
NotFromBrooklyn
  • 504
  • 2
  • 6
  • 17
0

They yum package is not installed by default in RHEL4, because it appeared later. You can installed it or use up2date command to install software.

  • Thanks for the information. So this is the reason. I never used rhel4 before so i had no idea about it. I started to learn from rhel5 – OmiPenguin May 20 '13 at 11:55