Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 教程 > Linux系统管理 > 正文

Redhat 7.0使用CentOS 7 的Yum 网络源

时间:2016-07-09 18:35 来源:网络整理 作者:linux系统 阅读:

redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了,不说费话了,我们还是来操作吧! 

1、首先查看redhat 7.0系统本身所安装的那些yum 软件包:

[root@localhost ~]# rpm -qa | grep yum
yum-utils-1.1.31-24.el7.noarch

yum-langpacks-0.4.2-3.el7.noarch

yum-metadata-parser-1.1.4-10.el7.x86_64

yum-rhn-plugin-2.0.1-4.el7.noarch

PackageKit-yum-0.8.9-11.el7.x86_64

yum-3.4.3-118.el7.noarch

2、删除这些软件包;

[root@localhost ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps

[root@localhost ~]# rpm -e yum-utils-1.1.31-24.el7.noarch --nodeps

[root@localhost ~]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps

[root@localhost ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps

[root@localhost ~]# rpm -e yum-langpacks-0.4.2-3.el7.noarch --nodeps

[root@localhost ~]# rpm -e PackageKit-yum-0.8.9-11.el7.x86_64 --nodeps

3、本机电脑得能上网;

[root@localhost ~]# ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=51.3 ms

64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=49.5 ms

4、进入以下网站上面查看软件包的版本是否升级或者找到自己系统所对应的文件包版本更新;

网易163网络源地址:

CentOS网络源地址:

5、找到自己所需要的版本下载:

[root@localhost ~]# wget 

[root@localhost ~]# wget 

[root@localhost ~]# wget 

[root@localhost ~]# wget 

[root@localhost ~]# wget 

6、查看下载完成结果;

[root@localhost ~]# ls

yum-3.4.3-118.el7.centos.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm

yum-updateonboot-1.1.31-24.el7.noarch.rpm

yum-utils-1.1.31-24.el7.noarch.rpm

7、安装软件包:

[root@localhost ~]# rpm -ivh yum-*

warning: yum-3.4.3-118.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%]

   2:yum-plugin-fastestmirror-1.1.31-2################################# [ 40%]

   3:yum-3.4.3-118.el7.centos         ################################# [ 60%]

   4:yum-updateonboot-1.1.31-24.el7   ################################# [ 80%]

   5:yum-utils-1.1.31-24.el7          ################################# [100%

8、新建repo 配置文件;

[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo

 

[base]

name=CentOS-$releasever -Base

baseurl=http://mirrors.sohu.com/centos/7/os/$basearch/

gpgcheck=1

 

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=http://mirrors.163.com/centos/7/updates/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 

#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons

baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/

gpgcheck=1

#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=http://mirrors.163.com/centos/7/extras/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/

gpgcheck=1

enabled=0

9、至此YUM 网络源已经安装完成;

[root@localhost ~]# yum clean all

10、测试安装是否正常;

[root@localhost ~]# yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel

Loaded plugins: fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

No package zlib-devel available.

No package pcre-devel available.

Resolving Dependencies

--> Running transaction check

---> Package openssl.x86_64 1:1.0.1e-34.el7 will be updated

---> Package openssl.x86_64 1:1.0.1e-34.el7_0.7 will be an update

--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-34.el7_0.7 for package: 1:openssl-1.0.1e-34.el7_0.7.x86_64

---> Package openssl-devel.x86_64 1:1.0.1e-34.el7_0.7 will be installed

--> Processing Dependency: zlib-devel(x86-64) for package: 1:openssl-devel-1.0.1e-34.el7_0.7.x86_64

--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.1e-34.el7_0.7.x86_64

--> Running transaction check

 

本文出自 “技术思想” 博客,请务必保留此出处

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《Redhat 7.0使用CentOS 7 的Yum 网络源》技术文章,《Redhat 7.0使用CentOS 7 的Yum 网络源》详细使用和说明,有时《Redhat 7.0使用CentOS 7 的Yum 网络源》可能不完善、敬请谅解!如果《Redhat 7.0使用CentOS 7 的Yum 网络源》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片