`
qpb681wk
  • 浏览: 18187 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

RHEL使用Centos的YUM源

阅读更多

RHEL使用Centos的YUM源
2011年11月04日
  因为 CentOS 是 RHEL 的完整重新编译版本(当然要相互对应一样的版本号),所以 RHEL 是一定可以用 CentOS 的 yum 源的。------------------------------------------------------------------------------------------------------------------------------------一/【删除 RHEL 自带的 yum】# rpm -aq|grep yum|xargs rpm -e --nodeps------------------------------------------------------------------------------------------------------------------------------------二/【下载】以下四个文件:# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-2.el5.i386.rpm# wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm------------------------------------------------------------------------------------------------------------------------------------三/【安装】# rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm# rpm -ivh yum-metadata-parser-1.1.2-2.el5.i386.rpm# rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpmwarning: yum-3.2.19-18.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897error: Failed dependencies:yum-fastestmirror is needed by yum-3.2.19-18.el5.centos.noarch# wget ftp://ftp.muug.mb.ca/mirror/centos/5.3/os/x86_64/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm# rpm -ivh yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpmwarning: yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897error: Failed dependencies:yum >= 3.0 is needed by yum-fastestmirror-1.1.16-13.el5.centos.noarch注意:安装的时候最好几个同时安装,如果单个安装的话可能会出现依赖问题。出现了相互依赖的问题。四/# rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm------------------------------------------------------------------------------------------------------------------------------------五/最后,下载配置文件:# wget http://sudone.com/download/CentOS-Base.repo -O /etc/yum.repos.d/CentOS-Base.repo这样就可以用 CentOS 的 yum 源来更新系统和安装软件了。因为默认的配置文件中服务器地址用的版本号是变量$releasever,所以需要将其替换为实际的版本号,否则是无法连接到服务器的,当前CentOS最新版是5.3,所以我们修改CentOS-Base.repovi CentOS-Base.repo 在vi编辑器中进行全文件替换:%s/$releasever/5.3/ 最后保存退出即可。------------------------------------------------------------------------------------------------------------------------------------另外,附上 x86_64 系统使用 CentOS 的 yum 源需要下载的四个包:wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.19-18.el5.centos.noarch.rpmwget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-2.el5.x86_64.rpmwget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpmwget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm------------------------------------------------------------------------------------------------------------------------------------【自动运行 yum】# chkconfig --list yum# chkconfig --level 3 yum on控制脚本 /etc/rc.d/init.d/yum,这个控制脚本激活了 /etc/cron.daily/yum.cron,而它又会使 cron 服务来在每日凌晨四点时进行自动的系统更新。
  1.CentOS yum使用:
  1   )包的更新
  1.1)检查可更新包: yum check-update
  1.2)更新所有包: yum update
  1.3)更新指定包: yum update package_name
  1.4)版本升级: yum upgrade
  2   )包安装与删除
  2.1)yum install package_name
  2.2)yum remove package_name
  3  )包搜索
  3.1)搜索特定包: yum search package_name
  3.2)搜索包含特定文件名的包:yum provides name
  4   )包列表
  4.1)列出所有安装或更新的包: yum list
  4.2)列出指定包:yum list name
  4.3)列出可更新包:yum list updates
  4.4)列出已安装包:yum list installed
  4.5)列出已安装但不包含在资源库中的包:yum list extras
  2.CentOS yum源设定
  2.1)加快yum下载速度: yum -y install yum-fastestmirror,在CentOs 4上名字叫做yum-plugin-fastestmirror
  2.2)yum源文件:/etc/yum.repos.d/CentOS-Base.repo
  2.3)CentOS 5的yum源设为上海交通大学网站
  CentOS-Base.repo
  [base]
  name=CentOS-5 - Base
  #mirrorlist= http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
  repo=os
  #baseurl= http://mirror.centos.org/centos/$releasever/os/$basearch/
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/os/$basearch/
  gpgcheck=1
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #released updates
  [update]
  name=CentOS-5 - Updates
  #mirrorlist= http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/updates/$basearch/
  gpgcheck=1
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #packages used/produced in the build but not released
  [addons]
  name=CentOS-5 - Addons
  #mirrorlist= http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/addons/$basearch/
  gpgcheck=1
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #additional packages that may be useful
  [extras]
  name=CentOS-5 - Extras
  #mirrorlist= http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/extras/$basearch/
  gpgcheck=1
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #additional packages that extend functionality of existing packages
  [centosplus]
  name=CentOS-5 - Plus
  #mirrorlist= http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/centosplus/$basearch/
  gpgcheck=1
  enabled=0
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #contrib - packages by Centos Users
  [contrib]
  name=CentOS-5 - Contrib
  #mirrorlist= http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
  baseurl= http://ftp.sjtu.edu.cn/centos/5.0/contrib/$basearch/
  gpgcheck=1
  enabled=0
  gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  a.执行64位:rpm --import http://ftp.sjtu.edu.cn/centos/5.0/os/x86_64/RPM-GPG-KEY-CentOS-532位:rpm --import http://ftp.sjtu.edu.cn/centos/5.0/os/i386/RPM-GPG-KEY-CentOS-5
  b.执行 yum update.
  设置CentOS yum源为国内服务器
  # CentOS-Base.repo
  # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
  # 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-5 - Base
  baseurl= http://mirror.be10.com/centos/5/os/i386/
  gpgcheck=1
  #released updates
  [update]
  name=CentOS-5 - Updates
  baseurl= http://mirror.be10.com/centos/5/updates/i386/
  gpgcheck=1
  #packages used/produced in the build but not released
  [addons]
  name=CentOS-5 - Addons
  baseurl= http://mirror.be10.com/centos/5/addons/i386/
  gpgcheck=1
  #additional packages that may be useful
  [extras]
  name=CentOS-5 - Extras
  baseurl= http://mirror.be10.com/centos/5/extras/i386/
  gpgcheck=1
  #additional packages that extend functionality of existing packages
  [centosplus]
  name=CentOS-5 - Plus
  baseurl= http://mirror.be10.com/centos/5/centosplus/i386/
  gpgcheck=1
  enabled=0
  #contrib - packages by Centos Users
  [contrib]
  name=CentOS-5 - Contrib
  baseurl= http://mirror.be10.com/centos/5/contrib/i386/
  gpgcheck=1
  enabled=0
  #packages in testing
  [testing]
  name=CentOS-5 - Testing
  baseurl= http://mirror.be10.com/centos/5/testing/i386/
  gpgcheck=1
  enabled=0
  a.执行:rpm --import http://mirror.be10.com/centos/RPM-GPG-KEY-CentOS-5
  3.这一篇文章只是就CentOS yum使用的基本进行整理,尚有许多未涉及到的地方。不过基本的CentOS yum使用已经足够。
分享到:
评论

相关推荐

    RHEL5下使用centos Yum源

    介绍如何在RHEL5没有subscription的情况下换用centos yum源

    rhel中yum源替换centos中yum源

    rhel中yum源替换centos中yum源

    RHEL 6.X使用CentOS yum源

    RHEL 6.X使用CentOS yum源,

    RHEL6使用CentOS6的yum源

    RHEL6使用CentOS6的yum源 利用yum安装php,mysql,apache

    redhat7替换使用CentOS yum源--博客附件

    redhat7替换使用CentOS yum源--博客附件;方便下载,改为1积分,CSDN好像最低就是1积分! 大家别下了,我怕资源失效,文章写好久了

    rhel6 86_64 使用CentOS yum源

    安装yum,必须按照顺序... file /usr/lib/python2.6/site-packages/yum/__init__.py from install of yum-3.2.29-40.el6.centos.noarch conflicts with file from package yum-3.2.27-14.el6.noarch ……其它输出略……

    RHEL5配置 CentOS YUM更新源

    NULL 博文链接:https://mypanpan.iteye.com/blog/1164635

    RHEL5的YUM源配置笔记

    RHEL5中YUM源的配置,包括将光碟、yum源网站,第三方Yum源,自己搭建yum源服务器等

    更改RHEL7.4的yum源.zip

    更改RHEL7.4 yum源。为了减去在开源网站寻找这几个文件的麻烦,所需的centos系统的.rpm文件已经打包好了。还包括了已经编写好了的.repo文件和一个FTP传输软件。

    rhel7 替换为CentOS源文件

    此文档为RHEL7的yum源替换为免费CentOS的yum源所需包。

    RHEL解决无法使用YUM源问题.pdf

    如何在RHEL中,解决无法使用YUM源问题 如何在RHEL中,解决无法使用YUM源问题 如何在RHEL中,解决无法使用YUM源问题 如何在RHEL中,解决无法使用YUM源问题 如何在RHEL中,解决无法使用YUM源问题

    redhat更改为centOS-6.4 yum源相关安装包

    redhat更改为centOS-6.4 yum源相关安装包

    RHEL/CentOS 6 Yum方式安装 MySQL5.7

    安装时先卸载mariadb 和 已安装的mysql:rpm –qa | grep maria, rpm –qa | grep –i mysql,rpm –e xxx --nodeps。 mysql5.7 rpm安装顺序,...安装过程报依赖错误,使用 rpm –ivh xxx --nodeps --force 即可。

    RHEL安装yum源

    yum-3.4.3-154.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm python-urlgrabber-3.10-8.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm rpm-4.11.3-25.el7.x86_64....

    RHEL/CentOS 7 Yum方式安装 MySQL5.7

    安装时先卸载mariadb 和 已安装的mysql:rpm –qa | grep maria, rpm –qa | grep –i mysql,rpm –e xxx --nodeps。 mysql5.7 rpm安装顺序,...安装过程报依赖错误,使用 rpm –ivh xxx --nodeps --force 即可。

    rhel5.6yum源配置

    本地yum配置(光盘)、网络yum配置(centsos源) 先试试将对应版本目录下的yum-centos.repo拷贝至/etc/yum.repos.d/下,运行yum makecache,若不能缓冲数据库,再看README。

    RHEL7-yum安装依赖.rpm.zip

    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget ...

    rhel源更换为centos源|所有需要的yun包

    rhel源更换为centos源| yum-3.2.29-40.el6.centos.noarch.rpm| yum-metadata-parser-1.1.2-16.el6.i686.rpm| yum-metadata-parser-1.1.2-16.el6.x86_64.rpm| yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

    RHEL.Centos.Fedora第三方软件库使用配置

    RHEL.Centos.Fedora第三方软件库(pbone.EPEL.RPMForge.RPMFusion)使用配置

    RHEL/CentOS 5 Yum方式安装 MySQL5.7

    安装时先卸载mariadb 和 已安装的mysql:rpm –qa | grep maria, rpm –qa | grep –i mysql,rpm –e xxx --nodeps。 mysql5.7 rpm安装顺序,...安装过程报依赖错误,使用 rpm –ivh xxx --nodeps --force 即可。

Global site tag (gtag.js) - Google Analytics