萬盛學電腦網

 萬盛學電腦網 >> 服務器教程 >> CentOSyum不能用

CentOSyum不能用

   修改/etc/yum.repos.d/Centos-Base.repo

  # CentOS-Base.repo

  #

  # The mirror system uses the connecting IP address of the client and the

  # update status of each mirror to pick mirrors that are updated to and

  # geographically close to the client. You should use this for CentOS updates

  # unless you are manually picking other mirrors.

  #

  # If the mirrorlist= does not work for you, as a fall back you can try the

  # remarked out baseurl= line instead.

  #

  #

  [base]

  name=CentOS-$releasever - Base - 163.com

  baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/

  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

  gpgcheck=1

  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

  #released updates

  [updates]

  name=CentOS-$releasever - Updates - 163.com

  baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/

  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

  gpgcheck=1

  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

  #additional packages that may be useful

  [extras]

  name=CentOS-$releasever - Extras - 163.com

  baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/

  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

  gpgcheck=1

  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

  #additional packages that extend functionality of existing packages

  [centosplus]

  name=CentOS-$releasever - Plus - 163.com

  baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/

  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

  gpgcheck=1

  enabled=0

  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

  #contrib - packages by Centos Users

  [contrib]

  name=CentOS-$releasever - Contrib - 163.com

  baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/

  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

  gpgcheck=1

  enabled=0

  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

  文件免費下載地址:http://download.csdn.net/detail/chenyiming_1990/7032825

  centos /etc/yum.repo.d/中.repo源的配置與編寫詳解

  # CentOS-Base.repo

  #

  # The mirror system uses the connecting IP address of the client and the

  # update status of each mirror to pick mirrors that are updated to and

  # geographically close to the client. You should use this for CentOS updates

  # unless you are manually picking other mirrors.

  #

  # If the mirrorlist= does not work for you, as a fall back you can try the

  # remarked out baseurl= line instead.

  #

  #

  [base] //唯一標識的名稱

  name=CentOS-$releasever - Base //所使用的.repo文件的名字

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

  #mirrorlist 是由 yum 程式自行去捉映射站台, baseurl 則是指定固定的一個容器網址

  #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

  #其中url支持的協議有 http:// ftp:// file://三種。baseurl後可以跟多個url,你可以自己改為速度比較快的鏡像站,但baseurl只能有一個

  gpgcheck=1 #gpg簽名檢查

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

  #gpg密鑰的位置,應指定本機的密鑰文件只有可以與服務器上的密鑰進行校驗。

  #released updates

  #該段指向的路徑是軟件升級時需要的軟件包

  [updates]

  name=CentOS-$releasever - Updates

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

  //該路徑對應服務器上的update文件夾,即自動到服務器updates文件夾裡找軟件包

  #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

  gpgcheck=1

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

  #packages used/produced in the build but not released

  #該段指向的路徑是已經使用了或者已經制作出來的軟件,但並沒有發行

  [addons]

  name=CentOS-$releasever - Addons

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons

  #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/

  gpgcheck=1

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

  #additional packages that may be useful

  #該段指向的路徑是可能有用的其他的軟件

  [extras]

  name=CentOS-$releasever - Extras

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

  #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

  gpgcheck=1

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

  #additional packages that extend functionality of existing packages

  #該段指向的路徑是已經存在的軟件的擴展軟件、插件等等

  [centosplus]

  name=CentOS-$releasever - Plus

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

  #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

  gpgcheck=1

  enabled=0 #enabled=0表示這個源停用 如果enabled不寫 表示enabled=1

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

  #contrib - packages by Centos Users

  #該段指向的路徑是系統使用者所貢獻的軟件

  [contrib]

  name=CentOS-$releasever - Contrib

  mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

  #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/

  gpgcheck=1

  enabled=0

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

copyright © 萬盛學電腦網 all rights reserved