I cannot yum install nor rpm anymore, please advise:

Issues related to applications and software problems
Post Reply
georgesjeandeni
Posts: 1
Joined: 2011/08/26 22:45:41
Location: montreal canada
Contact:

I cannot yum install nor rpm anymore, please advise:

Post by georgesjeandeni » 2011/08/26 23:34:04

We have installed a new centos server for testing. While configuring another software, I made the unforgivable mistake of doing the command:

yum erase ldap

This has lead to the error:

There was a problem importing one of the Python modules
...
No module named yum
...

I have tried reinstalling yum. However the command rpm yields:

-bash: rpm: command not found

Our sysadmin is on vacation. However, I remember him saying: don't use any rpm's. Which leads me to believe that either he removed
the command himself or I did with the above command.

I don't expect a miracle, however rather just a recommendation.

Should I attempt rebuilding the system from scracth (reinstalling centos)
OR
attempt to repair the yum installer?

Keep in mind however: my system is a virtual machine. I cannot put a cd into it.
I am willing to rebuild a system from scratch, but is that the best solution? I have a week or so to finish.
The getinfo.sh yields:

Information for general problems.
[code]
== BEGIN uname -rmi ==
2.6.32-71.29.1.el6.x86_64 x86_64 x86_64
== END uname -rmi ==

== BEGIN rpm -qa \*-release\* ==
./getinfo.sh: line 87: rpm: command not found
== END rpm -qa \*-release\* ==

== BEGIN cat /etc/redhat-release ==
CentOS Linux release 6.0 (Final)
== END cat /etc/redhat-release ==

== BEGIN getenforce ==
Disabled
== END getenforce ==

== BEGIN free -m ==
total used free shared buffers cached
Mem: 2005 635 1370 0 88 229
-/+ buffers/cache: 317 1688
Swap: 991 0 991
== END free -m ==

== BEGIN rpm -q yum rpm python ==
./getinfo.sh: line 87: rpm: command not found
== END rpm -q yum rpm python ==

== BEGIN ls /etc/yum.repos.d ==
attic
CentOS-Base.repo
CentOS-Media.repo
== END ls /etc/yum.repos.d ==

== BEGIN cat /etc/yum.conf ==
cat: /etc/yum.conf: No such file or directory
== END cat /etc/yum.conf ==

== BEGIN yum repolist all ==
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.6.5 (r265:79063, Jun 25 2011, 08:36:25)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq


== END yum repolist all ==

== BEGIN egrep 'include|exclude' /etc/yum.repos.d/*.repo ==
== END egrep 'include|exclude' /etc/yum.repos.d/*.repo ==

== BEGIN sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n ==
== END sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n ==

== BEGIN cat /etc/fstab ==

#
# /etc/fstab
# Created by anaconda on Wed Aug 10 22:08:27 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root / ext4 grpquota,usrquota,rw 0 1
UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0


172.16.0.237:/base/data/WebManager /srv/www nfs noatime,timeo=50,soft,tcp,nfsvers=3 0 0
== END cat /etc/fstab ==

== BEGIN df -h ==
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
19G 2.2G 16G 13% /
tmpfs 1003M 0 1003M 0% /dev/shm
/dev/vda1 485M 60M 401M 13% /boot
== END df -h ==

== BEGIN fdisk -l ==
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/vda: 21.5 GB, 21474836480 bytes
16 heads, 63 sectors/track, 41610 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00097e80

Device Boot Start End Blocks Id System
/dev/vda1 * 3 1018 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/vda2 1018 41611 20458496 8e Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/dm-0: 19.9 GB, 19906166784 bytes
255 heads, 63 sectors/track, 2420 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/dm-1: 1040 MB, 1040187392 bytes
255 heads, 63 sectors/track, 126 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

== END fdisk -l ==

== BEGIN blkid ==
/dev/vda1: UUID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TYPE="ext4"
/dev/vda2: UUID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TYPE="LVM2_member"
/dev/mapper/VolGroup-lv_root: UUID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TYPE="ext4"
/dev/mapper/VolGroup-lv_swap: UUID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TYPE="swap"
== END blkid ==

== BEGIN cat /proc/mdstat ==
Personalities :
unused devices: <none>
== END cat /proc/mdstat ==

== BEGIN pvs ==
PV VG Fmt Attr PSize PFree
/dev/vda2 VolGroup lvm2 a- 19.51g 0
== END pvs ==

== BEGIN vgs ==
VG #PV #LV #SN Attr VSize VFree
VolGroup 1 2 0 wz--n- 19.51g 0
== END vgs ==

== BEGIN lvs ==
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv_root VolGroup -wi-ao 18.54g
lv_swap VolGroup -wi-ao 992.00m
== END lvs ==

== BEGIN rpm -qa kernel\* | sort ==
./getinfo.sh: line 87: rpm: command not found
== END rpm -qa kernel\* | sort ==

== BEGIN lspci ==
./getinfo.sh: line 87: lspci: command not found
== END lspci ==

== BEGIN lspci -n ==
./getinfo.sh: line 87: lspci: command not found
== END lspci -n ==

== BEGIN lsusb ==
./getinfo.sh: line 87: lsusb: command not found
== END lsusb ==

== BEGIN ifconfig -a == xxxxxxxxxxxxxxxx
eth0 Link encap:Ethernet HWaddr xxxxxxxxxxxxxxxx
inet addr:xxxxxxxxxxxxxxxx Bcast:xxxxxxxxxxxxxxxx Mask:255.255.255.192
inet6 addr: xxxxxxxxxxxxxxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:420901 errors:0 dropped:0 overruns:0 frame:0
TX packets:51456 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43636021 (41.6 MiB) TX bytes:10101582 (9.6 MiB)

eth1 Link encap:Ethernet HWaddr xxxxxxxxxxxxxxxx
inet addr:xxxxxxxxxxxxxxxx Bcast:xxxxxxxxxxxxxxxx Mask:255.255.255.0
inet6 addr: xxxxxxxxxxxxxxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45749 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4851972 (4.6 MiB) TX bytes:810 (810.0 b)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5502 errors:0 dropped:0 overruns:0 frame:0
TX packets:5502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:483805 (472.4 KiB) TX bytes:483805 (472.4 KiB)

== END ifconfig -a ==

== BEGIN route -n ==
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxxxxxxxxxx 0.0.0.0 255.255.255.192 U 0 0 0 eth0
xxxxxxxxxxx 0.0.0.0 255.255.255.0 U 0 0 0 eth1
xxxxxxxxxxx 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
xxxxxxxxxxx 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 xxxxxxxxxxx 0.0.0.0 UG 0 0 0 eth0
== END route -n ==

== BEGIN cat /etc/resolv.conf ==
nameserver 127.0.0.1
nameserver xxxxxxxxxxx
nameserver xxxxxxxxxxx
== END cat /etc/resolv.conf ==

== BEGIN grep net /etc/nsswitch.conf ==
#networks: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
netmasks: files
networks: files
netgroup: nisplus
== END grep net /etc/nsswitch.conf ==

== BEGIN chkconfig --list | grep -Ei 'network|wpa' ==
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
== END chkconfig --list | grep -Ei 'network|wpa' ==

[/code]

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

I cannot yum install nor rpm anymore, please advise:

Post by TrevorH » 2011/08/27 16:23:46

Whatever it was that did that it was almost certainly [b]not[/b] `yum erase ldap` because there is no package called ldap to either erase or to install. Check /root/.bash_history for other candidate commands. The lack of both RPM and yum commands seems to imply a system that's either been intentionally broken (no idea why!) or one that's very badly borked. In either case, I would wait for your friendly neighbourhood sysadmin to return with his spade and dig you out of the hole you're in.

Post Reply