因为懒的折腾oracle的安装依赖包,所以准备配置yum源,方便快捷,网上搜索了一堆操作方法,浏览后总结一下自己的操作步骤:
1、卸载原有的yum安装包(因为是第一次配置yum源,如果不卸载的话,配置yum源之后,系统会一直提示你系统未注册什么的)
rpm -qa|grep yum |xargs rpm -e --nodeps
rpa -qa|grep yum --检查是否卸载完成
2、下载yum安装包(刚开始只下载了yum-3.2xxx的安装包,结果安装时,提示了有依赖包位安装,下面是所需要的包)
下载地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/(系统版本是6.4 X86的,版本不一致时,需要找到对应目录)
python-urlgrabber-3.9.1-11.el6.noarch.rpm
yum-3.2.29-81.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
3、安装yum包
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm (两个包相互依赖,需要同时安装,嫌弃麻烦可以直接将下载的包放一固定目录,然后安装所有的 rpm -ivh yum*)
可能遇到的问题
(1)、依赖包未安装 (此时下载相关的依赖包即可)
[root@localhost Packages]# rpm -ivh yum-3.2.29-40.el6.noarch.rpm
warning: yum-3.2.29-40.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
yum-metadata-parser >= 1.1.0 is needed by yum-3.2.29-40.el6.noarch
(2)、文件版本冲突(强制安装,采用参数 --force,网上还有建议用--replacefiles参数的,未试过)
[root@localhost temp]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch
4、验证是否安装成功
输入yum命令即可,成功则显示help信息,否则提示找不到该命令
5、配置yum源
(1)、粗暴一点,可以直接在/etc/yum.repos.d/目录下新建一个163.repo文件
[163]
name=163
baseurl=http://mirrors.163.com/centos/6/os/x86_64/
gpgcheck=0
enabled=1
(2)、推荐的操作方法
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
将下载的文件放在/etc/yum.repos.d/目录下,并修改该文件中的$releasever,将其修改为对应的版本号,我的为6
6、验证yum源是否配置成功。
yum update