zoukankan      html  css  js  c++  java
  • RedHat 6.2 Linux修改yum源免费使用CentOS源

    在没有光盘的情况,需要安装软件包,就要用到共网的yum源来安装了。

    RedHat linux 默认是安装了yum软件的,但是由于激活认证的原因让redhat无法直接进行yum安装一些软件,如果我们需要在redhat下直接yum安装软件,我们只用把yum的源修改成CentOS的就好了,然后把源里面的变量全部修改成实际的值,这样就能使用yum直接安装我们需要的软件了。

    使用说明

    1、到http://mirrors.163.com的 centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d中

    Centos 5    wget  http://mirrors.163.com/.help/CentOS5-Base-163.repo

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

    操作如下:

    2、首先备份/etc/yum.repos.d/CentOS-Base.repo

    3、编辑CentOS6-Base-163.repo文件,将其中的$releasever更改为centos的版本号,如果是RedHat 6.2 X86_64为例“baseurl=http://mirrors.163.com/centos/6.2/os/x86_64/”,本文档是以RedHat 6.2 32位为例所写!

    [base]

    name=CentOS-6.2 - Base - 163.com

    baseurl=http://mirrors.163.com/centos/6.2/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.2

    #released updates

    [updates]

    name=CentOS-6.2 - Updates - 163.com

    baseurl=http://mirrors.163.com/centos/6.2/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.2

    #additional packages that may be useful

    [extras]

    name=CentOS-6.2 - Extras - 163.com

    baseurl=http://mirrors.163.com/centos/6.2/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.2

    #additional packages that extend functionality of existing packages

    [centosplus]

    name=CentOS-6 .2- Plus - 163.com

    baseurl=http://mirrors.163.com/centos/6.2/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.2

    #contrib - packages by Centos Users

    [contrib]

    name=CentOS-6.2 - Contrib - 163.com

    baseurl=http://mirrors.163.com/centos/6.2/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.2

    编辑完后保存,运行:

    yum clean all 清除原有缓存

    yum makecache 获取yum列表

  • 相关阅读:
    如何分秒必争--浅淡时间切片器
    2019微软Power BI 每月功能更新系列——Power BI 6月版本功能完整解读
    2019微软Power BI 每月功能更新系列——Power BI 5月版本功能完整解读
    自制操作系统 ---- 资料
    [书籍推荐] 编程入门学习必备
    《30天自制操作系统》笔记5 --- (Day3)进入32位模式并导入C语言
    精彩知识视频分享
    《30天自制操作系统》笔记4 --- (Day2 下节)了解如何用汇编写操作系统中的HelloWorld
    《30天自制操作系统》笔记3 --- (Day2 上节)完全解析文件系统
    新版Notepad++加十六进制查看的插件HexEditor
  • 原文地址:https://www.cnblogs.com/ariclee/p/5740818.html
Copyright © 2011-2022 走看看