使用yum安装软时出错

HULIHONG 2009-11-30 09:28:42
RT

例如:
yum -install gcc-c++(其他的也同样报这个错误)
报如下错误:
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

网上没查到有用的东东。

Yum与python有什么关系吗?今天早上把python给删了,觉得没用。
...全文
654 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
unixlinuxsys 2009-12-03
  • 打赏
  • 举报
回复
先配置yum源
再安装
Lingxy 2009-12-01
  • 打赏
  • 举报
回复
python也删楼主强人也
HULIHONG 2009-12-01
  • 打赏
  • 举报
回复
试试,谢谢啊。
quansheng3510 2009-12-01
  • 打赏
  • 举报
回复
rm -rf /etc/yum.conf
cd /etc/yum.repos.d/
rm -rf rhel-debuginfo.repo
vi /etc/yum.conf
把下面的代码复制进去,保存,重启
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 - Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
# the other site: http://centos.candishosting.com.cn/centos/5/os/i386/
# you can find more site in: http://www.centos.org/modules/tinycontent/index.php?id=13
enabled=1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 - Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

到此就ok了 ,是不是很方便!!!,这个是中科大的源,号称每隔小时跟新一次,我使用的就是这个,下载速度相当的快。

HULIHONG 2009-12-01
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 hulihong 的回复:]
引用 2 楼 brookmill 的回复:
/usr/bin/yum实际上是一个脚本文件,第一行就是#!/usr/bin/python,它需要用python来执行这个脚本,所以没有python是不行的
楼主自己看看就明白了 vi /usr/bin/yum


谢谢

我自己装了一个python, 怎么还报没有yum模块呢?
[/Quote]

“我自己装了一个python, 怎么还报没有yum模块呢?”说错了,应该是怎么还报没有python模块?

呵呵:实际上就是这句:There was a problem importing one of the Python modules
required to run yum.

谢谢。

现在自己装了一个,应该怎么修改一下使得yum可以用呢,之前的是2.4的,下了个源码装不上,之后下了个2.5的,可以装上,从/usr/bin/yum的基本里看:
“There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

%s

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

不会是和版本有关系吧,或者是装了2.5的之后在那儿改动一下就可以正常运行了呢?谢谢。
HULIHONG 2009-12-01
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 brookmill 的回复:]
/usr/bin/yum实际上是一个脚本文件,第一行就是#!/usr/bin/python,它需要用python来执行这个脚本,所以没有python是不行的
楼主自己看看就明白了 vi /usr/bin/yum
[/Quote]

谢谢

我自己装了一个python, 怎么还报没有yum模块呢?
HULIHONG 2009-12-01
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 seeicool 的回复:]
python也删楼主强人也
[/Quote]

不是不知道他的用处吗,netstat一看,我的80端口都被它给占了,当时不是没感觉到它的用处吗,就干掉了。哎,现在知道用处了啊。
brookmill 2009-11-30
  • 打赏
  • 举报
回复
/usr/bin/yum实际上是一个脚本文件,第一行就是#!/usr/bin/python,它需要用python来执行这个脚本,所以没有python是不行的
楼主自己看看就明白了 vi /usr/bin/yum
rainsome 2009-11-30
  • 打赏
  • 举报
回复
yum install 不要 -

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧