学习Linux环境操作记录

学习Linux环境操作记录

修改yum源

备份yum

  • 首先备份系统默认的yum文件
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

选择yum

  • 下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

生成缓存

  • 之后运行yum makecache生成缓存

参考资料

个人微信公众号技术交流QQ群
文章目录
  1. 1. 修改yum源
    1. 1.1. 备份yum
    2. 1.2. 选择yum
      1. 1.2.1. CentOS 5
      2. 1.2.2. CentOS 6
      3. 1.2.3. CentOS 7
    3. 1.3. 生成缓存
    4. 1.4. 参考资料