• Linux yum源配置详解


    软件包安装方式

    默认从官网下载包(国内,雅虎,网易,阿里云)

    cat /etc/yum.repos.d/rhel-source.repo  【yum文件目录--redhat6版】

    【搜狐】http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
    【网易】http://mirrors.163.com/.help/CentOS6-Base-163.repo
    【阿里】https://mirrors.aliyun.com/help/centos

    yum :  Linux包管理器 ,解决依赖问题,方便快捷

    yum install XXX -y
    yum groupinstall XXX 包组的列表  -y
    yum grouplist 里面选择包组,然后yum groupinstall "包组" -y
    yum search  包名
    yum search all  查询所有
    yum remove tree -y  删除命令(不建议用,因为yum可以解决依赖问题,删除会删除所有包的依赖)
    yum update; 安装所有软件到最新版本

    rpm安装:

    rpm -ivh 包名  i==install h==human 人可读
    rpm -ivh 包名 安装软件
    rpm -qa  包名 查询包名
    最大的问题:就是安装包的依赖问题(a->b->c->d)

    源码安装:

    /configure; make; make install  源代码安装方式

    在线安装配置yum源

    # 查看操作系统版本
    cat /etc/redhat-release
    # 查看操作系统32/64位
    uname -m
    # 进入yum文件目录
    cd /etc/yum.repos.d
    # 备份源文件
    cp CentOS-Base.repo CentOS-Base.repo.bak 
    # 下载网易yum源
    wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 【网易】
    #【可选】下载阿里yum源
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo  【阿里】
    # 更改权限和属组
    chmod 644 CentOS6-Base-163.repo
    chown root.root CentOS6-Base-163.repo
    附[可选]:如果还是用不了yum,可以替换文件内的版本信息为你当前操作系统的版本,一般没问题的
    # 替换文件的版本信息
    sed -i 's/$releasever/6/g' CentOS6-Base-163.repo

    配置yum安装保存安装包

    # 更改配置文件
    sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
    # 进入路径下查看安装包
    cd /var/cache/yum/*/6/base/packages/
    # 查看更改后的文件信息<br><br>grep 'keep' /etc/yum.conf <br><br><br>

    附网易yum源:

    # CentOS-Base.repo
    #
    # 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-$releasever - Base - 163.com
    baseurl=http://mirrors.163.com/centos/$releasever/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/$releasever/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
    27 
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras - 163.com
    baseurl=http://mirrors.163.com/centos/$releasever/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/$releasever/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/$releasever/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

    附阿里配置文件:

    # CentOS-Base.repo
    #
    # 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-$releasever - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #released updates 
    [updates]
    name=CentOS-$releasever - Updates - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
  • 相关阅读:
    如何用Core Plot绘制柱状图
    如何定制Core Plot主题
    开源框架Core Plot的使用
    基于.NET平台的分层架构实战(七)——数据访问层的第一种实现:Access+SQL
    基于.NET平台的分层架构实战(十一)——表示层的实现
    CIO如何给自己的团队带来价值
    如何使用Core Plot绘制直方图和折线图
    在Windows平台下编译ObjectiveC(转载)
    新开通博客
    Java类中的对象
  • 原文地址:https://www.cnblogs.com/tu240302975/p/13427265.html
Copyright © 2020-2023  润新知