Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7770450
  • 博文数量: 701
  • 博客积分: 2150
  • 博客等级: 上尉
  • 技术积分: 13233
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-29 16:28
个人简介

天行健,君子以自强不息!

文章分类

全部博文(701)

文章存档

2019年(2)

2018年(12)

2017年(76)

2016年(120)

2015年(178)

2014年(129)

2013年(123)

2012年(61)

分类: 系统运维

2016-03-31 13:01:51

一、linux系统安装yum环境

1、卸载rhel的默认安装的yum包
查看yum包
rpm -qa|grep yum
卸载之
rpm -qa|grep yum|xargs rpm -e --nodeps


2、下载新的yum包
64位linux系统下载安装包
wget
wget
wget
32位linux系统下载安装包
wget
wget
wget


注意:安装包可能会升级,最后的文件名可以通过最新路径下查看得到,例如:




然后进行安装
rpm -ivh yum-*
注意:yum和yum-fastestmirror相互依赖,所以同时安装即可。
3、下载yum的配置源
wget 下载到 /etc/yum.repos.d/ 目录下面


4、运行yum makecache生成缓存

二、安装了Python2.7,发现yum无法使用

报错信息如下:
$ yum
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.7.3 (default, Jul 17 2014, 11:10:02) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]


If you cannot solve this problem yourself, please go to 
the yum faq at:
 

原因:
应该是系统是使用的默认的python2.4的版本

解决办法:
修改yum文件
#vim /usr/bin/yum

#!/usr/bin/python 
修改为 
#!/usr/bin/python2.4

三、yum 运行错误

错误提示:
$ yum list
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile




解决办法:
Centons下
其大概意思是fastestmirror不能使用,fastestmirror是yum的一个加速插件,具体我也没有仔细了解过,
可能是系统不支持或者缺少组建导致的。
处理办法就是禁用这个插件,方法如下:
$vim  /etc/yum/pluginconf.d/fastestmirror.conf   
  
[main]   
enabled=0  //把1改为0  
verbose=0  
socket_timeout=3  
hostfilepath=/var/cache/yum/timedhosts.txt   
maxhostfileage=10  
maxthreads=15  
#exclude=.gov, facebook
=======================================================================================
修改以下配置文件
 #vi /etc/yum.conf


[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1                 #将plugins的值修改为0
installonly_limit=5


四、yum运行错误

错误提示:
$ yum list
Segmentation Fault


解决办法:
# rpm -q zlib zlib-devel
# cp /usr/lib/libz.so.1.2.3 /usr/local/lib/
# cd /usr/local/lib                        
# ln -sf libz.so.1.2.3 libz.so             
# ln -sf libz.so.1.2.3 libz.so.1
# yum clean all


阅读(2193) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~