设为首页收藏本站

ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

搜索
查看: 2998|回复: 1

CentOS镜像使用帮助,使用edu智能yum软件库,来加快yum源的更新速度和使用新版软件

[复制链接]
 成长值: 258

签到天数: 4711 天

[LV.Master]伴坛终老

发表于 2014/8/6 19:47 | 显示全部楼层 |阅读模式 | Google Chrome 35.0.1916.153| Windows
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
收录架构

i386
x86_64
收录版本

5
6
7
使用说明

首先备份CentOS-Base.repo

  1. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
复制代码


下载对应版本的CentOS-Base.repo, 放入/etc/yum.repos.d/

这是CentOS 5的:
  1. wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1
复制代码
  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #

  12. [base]
  13. name=CentOS-$releasever - Base - mirrors.ustc.edu.cn
  14. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
  15. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  16. gpgcheck=1
  17. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

  18. #released updates
  19. [updates]
  20. name=CentOS-$releasever - Updates - mirrors.ustc.edu.cn
  21. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
  22. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  23. gpgcheck=1
  24. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-$releasever - Extras - mirrors.ustc.edu.cn
  28. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
  29. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  30. gpgcheck=1
  31. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

  32. #packages used/produced in the build but not released
  33. [addons]
  34. name=CentOS-$releasever - Addons - mirrors.ustc.edu.cn
  35. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/addons/$basearch/
  36. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
  37. gpgcheck=1
  38. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  39. #additional packages that extend functionality of existing packages
  40. [centosplus]
  41. name=CentOS-$releasever - Plus - mirrors.ustc.edu.cn
  42. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
  43. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  44. gpgcheck=1
  45. enabled=0
  46. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

  47. #contrib - packages by Centos Users
  48. [contrib]
  49. name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cn
  50. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/
  51. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  52. gpgcheck=1
  53. enabled=0
  54. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
复制代码



这是CentOS 6的:
  1. wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2
复制代码
  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #

  12. [base]
  13. name=CentOS-$releasever - Base - mirrors.ustc.edu.cn
  14. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
  15. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  16. gpgcheck=1
  17. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

  18. #released updates
  19. [updates]
  20. name=CentOS-$releasever - Updates - mirrors.ustc.edu.cn
  21. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
  22. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  23. gpgcheck=1
  24. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-$releasever - Extras - mirrors.ustc.edu.cn
  28. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
  29. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  30. gpgcheck=1
  31. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-$releasever - Plus - mirrors.ustc.edu.cn
  35. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
  36. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

  40. #contrib - packages by Centos Users
  41. [contrib]
  42. name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cn
  43. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/
  44. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
复制代码



这是CentOS 7的:
  1. wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3
复制代码
  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #

  12. [base]
  13. name=CentOS-$releasever - Base
  14. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  15. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
  16. gpgcheck=1
  17. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

  18. #released updates
  19. [updates]
  20. name=CentOS-$releasever - Updates
  21. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  22. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
  23. gpgcheck=1
  24. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-$releasever - Extras
  28. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  29. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
  30. gpgcheck=1
  31. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-$releasever - Plus
  35. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  36. baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
复制代码



运行
  1. yum clean all
  2. yum makecache
复制代码

生成缓存



欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

爱是什么东西 该用户已被删除
发表于 2014/8/6 20:07 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 新浪微博账号登陆用百度帐号登录

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2024/11/27 14:41 , Processed in 0.195582 second(s), 26 queries , MemCache On.

Powered by itzmx! X3.4

© 2011- sakura

快速回复 返回顶部 返回列表