当前位置:   article > 正文

redhat6添加yum_redhat6 yum

redhat6 yum
64位Redhat6.6未注册 ,yum改成 CentOS6.6 的方法

1.删除rhel6.6自带的yum:
命令如下:    rpm -qa | grep yum | xargs rpm -e --nodeps


2.下载CentOS 6.6的yum,命令如下: 

【 注意】先访问http://mirrors.163.com/centos/6/os/x86_64/Packages/,看看里面的版本号更新了没,要同步,否则会失败。
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm


3.安装yum: 
rpm -ivh  python-iniparse-0.3.1-2.1.el6.noarch.rpm 
rpm -ivh  yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 

下面安装失败了

# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm:Header V3 RSA /SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
        python-urlgrabber >= 3.9.1-10 is needed byyum-3.2.29-81.el6.centos.noarch
You have new mail  in /var/spool/mail/root

 

少python-urlgrabber 组件,下载:

 

http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

# rpm -ivh python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm --nodeps --force
warning:python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
   1 :python-urlgrabber     ########################################### [ 100 %]

# rpm -ivh yum- 3.2 . 29 - 81 .el6.centos.noarch.rpm yum-plugin-fastestmirror- 1.1 . 30 - 37 .el6.noarch.rpm
warning:yum- 3.2 . 29 - 81 .el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
   1 :yum-plugin-fastestmirro########################################### [ 50 %]
   2 :yum                   ########################################### [ 100 %]


4.配置repo文件: 

在/etc/yum.repos.d/目录下去除原有的*.repo文件,新建一个新的CentOS-Base.repo文件,该文件的内容如下:
##CentOS-Base.repo
###【注意啦】下面代码中为了通用性用$releasever指代版本号,如果你要更新6.6的就写6.6,其他版本可照猫画虎。
[base]
name=CentOS-$releasever-Base-163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#released updates 
[updates]
name=CentOS-$releasever-Updates-163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-$releasever-Extras-163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever-Plus-163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever-Contrib-163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

方法二

下载repo文件 到  /etc/yum.repos.d/

http://mirrors.163.com/.help/CentOS6-Base-163.repo


5.清除原有缓存:


yum clean all 


6.重建缓存,以提高搜索安装软件的速度:

yum makecache


7.更新系统 :  

yum update (时间会比较久)


至此就完成对yum源的配置,接下来就可使用yum 进行软件升级与安装。


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/168802
推荐阅读
相关标签
  

闽ICP备14008679号