美文网首页
CentOS更改yum源与更新系统

CentOS更改yum源与更新系统

作者: 骑着笨鸟飞 | 来源:发表于2015-10-05 08:25 被阅读521次

    CentOS更改yum源与更新系统

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

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

    1. 进入yum源配置文件所在文件夹

    cd /etc/yum.repos.d/

    1. 下载163的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份),同时

    提供sohu源(wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

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

    1. 运行yum makecache生成缓存

    yum makecache

    1. 更新系统

    yum -y update


    为CentOS安装EPEL软件仓库

    • EPEL全称: Extra Packages for Enterprise Linux.传说中最全的yum源

    • 通过以下命令安装:

    • CentOS 6.x 32-bit

    rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-7.noarch.rpm

    • CentOS 6.x 64-bit

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

    • CentOS 5.x 32-bit

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

    • CentOS 5.x 64-bit

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

    想暂停使用EPEL,在下面的文件中设置enabled=0即可.

    vim /etc/yum.repos.d/epel.repo

    相关文章

      网友评论

          本文标题:CentOS更改yum源与更新系统

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