首页 > 系统服务 > 详细

RedHat版的linux安装yum源

时间:2016-03-19 12:43:02      阅读:275      评论:0      收藏:0      [点我收藏+]

一、前言

  最近正在学习redis,但是在安装redis的时候遇到很多坎,在此记录一下。

  硬件环境:我用 VMware Workstation Pro 12 安装 Red Hat Enterprise Linux 7  

  终端工具:SecureCRT 5

  软件版本:redis-3.0.0.tar.gz

二、遇到的问题及解决

  当进入解压(tar -zxvf *)后的 redis-3.0.0,执行 make 编译命令时,提示 gcc 未安装。所以开始着手安装 gcc ,通过搜索网上相关资料,

尝试用 yum install gcc 进行安装,但提示我未找到相关的源。后来通过 http://blog.chinaunix.net/uid-20729583-id-2972852.html,

该博文进行设置,如下:  

检查yum是否安装,默认情况下都是安装好的
    [root@linux-a ~]# rpm -qa |grep yum

配置yum更新源  

创建/etc/yum.repos.d/CentOS-Base.repo文件,定义yum更新源,这里使用的是上海交大的CentOS更新源

    [root@linux-a ~]# vi /etc/yum.repos.d/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/os/$basearch/
    gpgcheck=0
    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/updates/$basearch/
    gpgcheck=0
    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/addons/$basearch/
    gpgcheck=0
    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/extras/$basearch/
    gpgcheck=0
    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/centosplus/$basearch/
    gpgcheck=0
    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/contrib/$basearch/
    gpgcheck=0
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
    # vi dag.repo
    [dag]
    name=Dag RPM Repository for RHEL5
    baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
    enabled=1
    gpgcheck=0
    gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

  导入key配置yum

[root@linux-a ~]# rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

  以上配置好yum,然后通过yum进行安装。

  

  

RedHat版的linux安装yum源

原文:http://www.cnblogs.com/jerrylz/p/5294790.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!