1: 使用 root 权限, 从根目录到 yum.repo.d 文件下
1 cd etc/yum.repos.d
2, 备份 ContOS.repo
1 mv CentOS-Base.repo CentOS-Base.repo.backup
3, 从 url 中下载所对应的 repo 文件
1 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 配置 163 的 yum 源
1, 首先备份当前系统的 yum 源
# mv /etc/yum.repo.d/CentOS-Base.repo /etc/yum.repo.d/CentOS-Base.repo.d.bak
2, 在 http://mirrors.centos.com/.html / 下载相对应版本的 repo 文件, 放入到 / etc/yum.repo.d/
3, 将 CentOS6-Base-163.repo 重命名为 CentOS-Base.repo
4, 执行以下命令:
- # yum clean all
- # yum makecache
- # yum update
2, 在 163 源的基础上以 pkgs.org 配置第二 yum 源
- # VIM /etc/yum.repo.d/linuxtech.repo
- [linuxtech] name=LinuxTECH baseurl=http://pkgrepo.linuxtech.net/el6/release/ enabled=1 gpgcheck=1 gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
来源: