美文网首页Linux日常运维
Centos使用yum安装软件优化

Centos使用yum安装软件优化

作者: 小胡_鸭 | 来源:发表于2020-03-03 23:32 被阅读0次

    一、安装epel-release

      经常有使用yum安装软件时找不到软件包的问题,可以先安装epel-release,再尝试安装所要安装的软件包

    yum install -y epel-release
    


    二、更新yum源

      经常有安装软件下载软件时过慢的问题,这是因为用了国外的源,换成国内的阿里的源,需要做的操作如下。

    1、备份原来的yum源

    sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    

    2、设置阿里云的yum源

    sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    

    3、添加EPEL源

    sudo wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
    

    4、清理缓存,生成新缓存,执行yum更新

    sudo yum clean all
    sudo yum makecache
    sudo yum update
    

    相关文章

      网友评论

        本文标题:Centos使用yum安装软件优化

        本文链接:https://www.haomeiwen.com/subject/wybrlhtx.html