简体   繁体   English

sudo su命令在OEL 7中不起作用

[英]sudo su command not working in OEL 7

I want to install glibc-2.17-105.el7.i686 我想安装glibc-2.17-105.el7.i686

But I'm not able to do sudo yum install . 但是我无法执行 sudo yum install

sudo yum install glibc-2.17-105.el7.i686 , gives error sudo yum install glibc-2.17-105.el7.i686 ,给出错误

-bash: /usr/local/bin/sudo: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory -bash:/ usr / local / bin / sudo:/lib/ld-linux.so.2:错误的ELF解释器:没有这样的文件或目录

bash: /usr/local/bin/sudo: /lib/ld-linux.so.2: bad ELF interpreter

This means: 这意味着:

  1. You have a 32-bit /usr/local/bin/sudo binary and 您有一个32位/usr/local/bin/sudo二进制文件,
  2. You do not have 32-bit runtime libraries installed. 没有安装32位运行时库。

If you are lucky, you have a 64-bit /usr/bin/sudo ( /usr/local/bin is not the default location for sudo ). 如果幸运的话,您可以使用64位/usr/bin/sudo/usr/local/bin 不是 sudo的默认位置)。 If so, you should be able to do this: 如果是这样,您应该能够做到这一点:

 /usr/bin/sudo rm /usr/local/bin/sudo

after which "normal" 64-bit sudo (which would now be /usr/bin/sudo ) will just work. 之后,“正常的” 64位sudo (现在为/usr/bin/sudo )将开始工作。

If you are unlucky, but your system allows root login (and you know root password), then simply login as root, and: 如果您很不幸,但是您的系统允许root登录(并且您知道root密码),那么只需以root身份登录,然后:

# should make 32-bit /usr/local/bin/sudo work
root@host# yum install glibc-2.17-105.el7.i686 

If you have no root password, and no working sudo , not all is lost: with physical access to the system, you could boot off the recovery disk, mount your root filesystem, and fix root password. 如果您没有root密码,也没有有效的sudo ,那么一切都不会丢失:通过对系统的物理访问,您可以启动恢复磁盘,挂载根文件系统,并修复root密码。 You may as well copy a working sudo to /usr/bin at the same time. 您也可以同时将可用的sudo复制到/usr/bin

From my experience you are in a bad situation. 根据我的经验,你处境很糟。 It's very bad that you have lib errors, I believe because of this error you will have problems running most of your executables on your system and that makes debugging and fixing much harder. 遇到lib错误是非常糟糕的,我相信由于这个错误,您在系统上运行大多数可执行文件时会遇到问题,这使得调试和修复变得更加困难。

It's most likely a filesystem corruption but I'm not sure if it can be fixed. 这很可能是文件系统损坏,但我不确定是否可以修复。

I would try to go to single user mode, remount / as read only, then do a fsck on it(depending on your filesystem it may be e2fsck or other). 我会尝试进入单用户模式,重新挂载/为只读,然后在其上执行fsck(取决于您的文件系统,它可能是e2fsck或其他)。

If it doesn't work, another path would be to boot from a rescue disk and do fsck or try other methods of fixing. 如果不起作用,另一种方法是从应急磁盘启动并执行fsck或尝试其他修复方法。

You may have to backup any data and reinstall. 您可能需要备份所有数据并重新安装。 Please backup ASAP! 请尽快备份!

Good luck! 祝好运!

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

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