修改Centos的yum源

來源:互聯網
上載者:User
yum安裝方式在有網路環境的時候非常方便,選擇一個比較快的yum源是非常有意義的(1)自動選擇最快的源     由於yum中有的mirror速度是非常慢的,如果yum選擇了這個mirror,這個時候yum就會非常慢,對此,可以下載fastestmirror外掛程式,它會自動選擇最快的mirror:yum install yum-fastestmirror -yfastestmirror設定檔:(一般不用動)/etc/yum/pluginconf.d/fastestmirror.conf你的yum鏡像的速度測試記錄檔案:/var/cache/yum/timedhosts.txt(2)一直受不了centos的更新源的速度,現在弄好了。更新200多MB的東東,5分鐘搞定。1 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.old2  建立新的repo檔案vi /etc/yum.repos.d/CentOS-Base.repo引用# CentOS-Base.repo## This file uses a new mirrorlist system developed by Lance Davis for CentOS.# 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-5.0 - Basebaseurl=http://mirror.be10.com/centos/5/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#released updates[update]name=CentOS-5.0 - Updatesbaseurl=http://mirror.be10.com/centos/5/updates/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#packages used/produced in the build but not released[addons]name=CentOS-5.0 - Addonsbaseurl=http://mirror.be10.com/centos/5/addons/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that may be useful[extras]name=CentOS-5.0 - Extrasbaseurl=http://mirror.be10.com/centos/5/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that extend functionality of existing packages[centosplus]name=CentOS-5.0 - Plusbaseurl=http://mirror.be10.com/centos/5/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#contrib - packages by Centos Users[contrib]name=CentOS-5.0 - Contribbaseurl=http://mirror.be10.com/centos/5/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#packages in testing[testing]name=CentOS-5.0 - Testingbaseurl=http://mirror.be10.com/centos/5.0/testing/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5[root@localhost yum.repos.d]# yum upgrade
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.