redhat6下安装centos的yum源
因为redhat中的yum是收费的,未注册时不允许使用的,下面是挂载光盘后的情况,未挂载是没有yum命令。但是下面即便挂载了也是需要验证的
[root@localhost /]# yum install openssl
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Nothing to do
所以最好是去使用centos的yum源,免费的。
推文:https://blog.csdn.net/yingfengjia520/article/details/54866007
安装步骤:
一:查看原来的yum源,删除原有yum源
rpm -aq | grep yum #查看
rpm -aq | grep yum|xargs rpm -e --nodeps #删除
二:下载centos的yum安装包
这里使用网易的yum源即可,快些
http://mirrors.163.com/centos/6/os/x86_64/Packages/ #修改前面的6可以修改centos版本 注意(x86_64是64位系统,i386是32位)
安装yum源的相关依赖包
http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum源包
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-updateonboot-1.1.30-40.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-utils-1.1.30-40.el6.noarch.rpm
注意:在上面yum源包中yum=metadata-parser是需要系统版本要求,需要64位,这里我们的系统是32位,会出现错误
error: Failed dependencies:
libc.so.()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libc.so.(GLIBC_2.2.5)(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libglib-2.0.so.()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libpthread.so.()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libpython2..so.1.0()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libsqlite3.so.()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libxml2.so.()(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
libxml2.so.(LIBXML2_2.4.30)(64bit) is needed by yum-metadata-parser-1.1.-.el6.x86_64
错误原因:版本不符
所以我们需要再去下载一个32位的包,原来的删掉
http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
[root@localhost yum]# rm -rf yum-metadata-parser-1.1.-.el6.x86_64.rpm
三:上传安装包
[root@localhost yum]# ls
python-iniparse-0.3.-2.1.el6.noarch.rpm
python-urlgrabber-3.9.-.el6.noarch.rpm
yum-3.2.-.el6.centos.noarch.rpm
yum-metadata-parser-1.1.-.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm
yum-updateonboot-1.1.-.el6.noarch.rpm
yum-utils-1.1.-.el6.noarch.rpm
四:先安装python依赖包
[root@localhost yum]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
warning: python-iniparse-0.3.-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [%]
package python-iniparse-0.3.-2.1.el6.noarch is already installed
[root@localhost yum]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
warning: python-urlgrabber-3.9.-.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [%]
file /usr/lib/python2./site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.-.el6.noarch conflicts with file from package python-urlgrabber-3.9.-.el6.noarch
file /usr/lib/python2./site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.9.-.el6.noarch conflicts with file from package python-urlgrabber-3.9.-.el6.noarch
file /usr/lib/python2./site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.9.-.el6.noarch conflicts with file from package python-urlgrabber-3.9.-.el6.noarch
file /usr/lib/python2./site-packages/urlgrabber/progress.pyc from install of python-urlgrabber-3.9.-.el6.noarch conflicts with file from package python-urlgrabber-3.9.-.el6.noarch
file /usr/lib/python2./site-packages/urlgrabber/progress.pyo from install of python-urlgrabber-3.9.-.el6.noarch conflicts with file from package python-urlgrabber-3.9.-.el6.noarch
这里发现:安装python-urlgrabber与原来的python中的插件冲突(已经安装了一个低版本的,我们要先去卸载他)
[root@localhost yum]# rpm -qa|grep python-url 查看已安装的旧版本python-urlgrabber
python-urlgrabber-3.9.1-8.el6.noarch
[root@localhost yum]# rpm -e --nodeps python-urlgrabber-3.9.1-8.el6.noarch #强制卸载
[root@localhost yum]# rpm -qa|grep python-url
[root@localhost yum]#
再次去安装新的python-urlgrabber
[root@localhost yum]# rpm -ivh python-urlgrabber-3.9.-.el6.noarch.rpm
warning: python-urlgrabber-3.9.-.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [%]
:python-urlgrabber ########################################### [%]
成功!!
五:开始安装yum源
[root@localhost yum]# ls
yum-3.2.-.el6.centos.noarch.rpm
yum-metadata-parser-1.1.-.el6.i686.rpm
yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm
yum-updateonboot-1.1.-.el6.noarch.rpm
yum-utils-1.1.-.el6.noarch.rpm
[root@localhost yum]# rpm -ivh yum-*
注意:有可能你之前有安装过其他的yum包,没有卸载干净,这时我们需要先去卸载掉原有的
[root@localhost yum]# rpm -qa| grep yum
yum-updateonboot-1.1.-.el6.noarch
yum-3.2.-.el6.noarch
yum-utils-1.1.-.el6.noarch
yum-rhn-plugin-0.9.-.el6.noarch
PackageKit-yum-0.5.-.el6.i686
yum-plugin-security-1.1.-.el6.noarch
yum-plugin-fastestmirror-1.1.-.el6.noarch
yum-metadata-parser-1.1.-.el6.i686
PackageKit-yum-plugin-0.5.-.el6.i686
将所有的卸载掉
[root@localhost yum]# rpm -e --nodeps yum-3.2.-.el6.noarch
[root@localhost yum]# rpm -e --nodeps yum-updateonboot-1.1.-.el6.noarch
[root@localhost yum]# rpm -e --nodeps yum-plugin-fastestmirror-1.1.-.el6.noarch
[root@localhost yum]# rpm -e --nodeps yum-metadata-parser-1.1.-.el6.i686
[root@localhost yum]# rpm -e --nodeps yum-utils-1.1.-.el6.noarch
[root@localhost yum]# rpm -e --nodeps yum-plugin-security-1.1.-.el6.noarch
[root@localhost yum]# rpm -e --nodeps PackageKit-yum-plugin-0.5.-.el6.i686
[root@localhost yum]# rpm -e --nodeps yum-rhn-plugin-0.9.-.el6.noarch
重新安装:
[root@localhost yum]# rpm -ivh yum-*
warning: yum-3.2.-.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [%]
:yum-metadata-parser ########################################### [ %]
:yum-plugin-fastestmirro########################################### [ %]
:yum ########################################### [ %]
:yum-updateonboot ########################################### [ %]
:yum-utils ########################################### [%]
安装完成!!
六:修改yum的repo配置文件
[root@localhost yum]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
epel.repo epel-testing.repo packagekit-media.repo rhel-source.repo
[root@localhost yum.repos.d]# rm -rf *
下载centos的repo文件,放到上面的文件夹下
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo #没有网可以直接下载,再去上传
[root@localhost yum.repos.d]# ls
CentOS6-Base-.repo
修改配置文件:将baseurl中的$releasever修改为centos版本号,这里使用6既可以
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base - .com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$releasever - Updates - .com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - .com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - .com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - .com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
原来文件内容
# CentOS-Base.repo
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$ - Base - .com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$ - Updates - .com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$ - Extras - .com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$ - Plus - .com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$ - Contrib - .com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
修改后的文件
七:修改后的测试
yum clean all #清空缓存
显示已安程序包及可安程序包
yum list #需要联网
测试安装OpenSSL
[root@redhat2 yum.repos.d]# yum install openssl
Loaded plugins: fastestmirror, product-id, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package openssl.i686 :1.0.-.el6_2. will be updated
---> Package openssl.i686 :1.0.1e-.el6 will be an update
--> Finished Dependency Resolution Dependencies Resolved ================================================================================================================
Package Arch Version Repository Size
================================================================================================================
Updating:
openssl i686 1.0.1e-.el6 base 1.5 M Transaction Summary
================================================================================================================
Upgrade Package(s) Total size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
From : http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found pre-existing rpmdb problem(s), 'yum check' output follows:
PackageKit-0.5.-.el6.i686 has missing requires of PackageKit-yum = ('', '0.5.8', '20.el6')
PackageKit-0.5.-.el6.i686 has missing requires of PackageKit-yum-plugin = ('', '0.5.8', '20.el6')
rhn-check-1.0.-.el6.noarch has missing requires of yum-rhn-plugin >= ('', '0.9.1', '')
Updating : openssl-1.0.1e-.el6.i686 /
Cleanup : openssl-1.0.-.el6_2..i686 /
Installed products updated.
Verifying : openssl-1.0.1e-.el6.i686 /
Verifying : openssl-1.0.-.el6_2..i686 / Updated:
openssl.i686 :1.0.1e-.el6 Complete!
成功!!正确
redhat6下安装centos的yum源的更多相关文章
- centos6.7不联网的情况下安装配置本地yum源
1 cd / 2 mkdir -p /app/ios 3 cd /opt mkdir ios 4 把下载好的centos-6.7-x86_64-bin-dvd1.iso 上传到 /o ...
- redhat 7安装CentOS 7 yum源
http://www.bubuko.com/infodetail-2004218.html http://www.bubuko.com/infodetail-2004218.html ******** ...
- CentOS使用yum源中自带的rpm包安装LAMP环境
CentOS使用yum源中自带的rpm包安装LAMP环境.这是Linux下安装LAMP的环境一种最基本最简便的方式.新手可以从容安装使用. 1. 安装基础包(可选安装)yum install -y w ...
- Redhat6下安装QEMU
Redhat6下安装QEMU 1.下载QEUM:http://wiki.qemu.org/Download 2.解压qemu-1.6.1.tar.bz2到/tmp目录(也可以是其他目录)下,并进入解压 ...
- Centos更换yum源
Centos更换yum源 步骤如下: 备份原始源 cd /etc/yum.repos.d/ mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/ ...
- 修改CentOS默认yum源为国内yum镜像源
CentOS默认的yum源不是国内的yum源,在通过yum安装一些软件的时候,会出现这样那样的错误,以及在下载安装的速度上也是非常慢的. 所以这个时候就需要将yum源替换成国内的yum源,国内主要开源 ...
- Red Hat6设置使用CentOS的yum源
环境查看 red hat系统使用自己默认的yum源未注册在使用yum安装软件的时候会出现以下错误提示 可以修改成centos的yum源 卸载yum软件 rpm -qa|grep yum|xargs r ...
- centos配置yum源为中国镜像源
有时候CentOS默认的yum源不一定是国内镜像,导致yum在线安装及更新速度不是很理想.这时候需要将yum源设置为国内镜像站点.国内主要开源的开源镜像站点应该是网易和阿里云了. 修改CentOS默认 ...
- [转载]Redhat Enterprise 6.1 如何使用免费的CentOS的yum源
Redhat Enterprise 6.1 如何使用免费的CentOS的yum源 graybull posted @ 2013年2月18日 22:29 in Unix/Linux with tags ...
随机推荐
- JAVA 对象序列化——Serializable
1.序列化是干什么的? 简单说就是为了保存在内存中的各种对象的状态(也就是实例变量,不是方法),并且可以把保存的对象状态再读出来.虽然你可以用你自己的各种各样的方法来保存object st ...
- Swift-懒加载使用
// 懒加载 lazy var tableView : UITableView = { let tempTableView = UITableView() ret ...
- HTML与URL两种录制模式分析(转)
如何选择两种模式? 1.基于浏览器的应用程序推荐使用HTML-Based Script. 2.不是基于浏览器的应用程序推荐使用URL-Based Script. 3.如果基于浏览器的应用程序中包含了J ...
- requests爬取知乎话题和子话题
zhihu.py # *_*coding:utf-8 *_* import pymysql import requests from lxml import etree from requests_t ...
- 数组 javaScript权威指南笔记
创建数组 var a=[1,2,3,4] var arr=new Array() var arr=new Array(10);//创建长度为10的数组 var arr=new Array(1,2, ...
- logback错误日志发送邮件
logback 一.介绍 logback是由log4j的作者开发的一个开源日志组件,用以替代log4j. logback由3个部分组成: ♦ logback-core (基础模块) ♦ logback ...
- IE显示对象不支持此属性或方法 的解决方法
用C# 编写的ActiveX控件, 调试时,在世界之窗浏览器里能正确显示,但是不能和JS交互,也没有传说中的错误信息框出现,查了很多文档,后来想问题是不是出在浏览器上,换在IE8里调试,点击交互按钮, ...
- linux 关机、重启
一.重启命令:1.reboot2.shutdown -r now 立刻重启(root用户使用)3.shutdown -r 10 过10分钟自动重启(root用户使用) 4.shutdown -r 20 ...
- spring+struts整合
首先是为什么整合strut2和spring? struts2的action是由struts2自己创建出来的,它不受spring的委托,也不受spring的管理,所以无法进行自动注入:spring和st ...
- python模拟浏览器爬取数据
爬虫新手大坑:爬取数据的时候一定要设置header伪装成浏览器!!!! 在爬取某财经网站数据时由于没有设置Header信息,直接被封掉了ip 后来设置了Accept.Connection.User-A ...