CentOS yum源配置小技巧

來源:互聯網
上載者:User

標籤:yum源配置小技巧

一、配置yum源

網易(163)yum源是國內最好的yum源之一 ,無論是速度還是軟體版本,都非常的不錯,將yum源設定為163yum,可以提升軟體包安裝和更新的速度,同時避免一些常見軟體版本無法找到。具體設定方法如下: 

1,進入yum源配置目錄

#cd /etc/yum.repos.d

2,備份系統內建的yum源

#mv CentOS-Base.repo CentOS-Base.repo.bk

下載163網易的yum源:

#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

3,更新玩yum源後,執行下邊命令更新yum配置,使操作立即生效

#yum makecache

4,除了網易之外,國內還有其他不錯的yum源,比如中科大和搜狐的,大家可以根據自己需求下載

中科大的yum源:

#wget http://centos.ustc.edu.cn/CentOS-Base.repo

sohu的yum源

#wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

理論上講,這些yum源redhat系統以及fedora也是可以用 的,但是沒有經過測試,需要的可以自己測試一下。

二、安裝yum-downloadonly,下載rpm軟體包

安裝yum-downloadonly外掛程式,下載rpm包;

 

#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo#yum install yum-downloadonly#yum install --downloadonly --downloaddir=/nginx.rpm pcre

如果下載不到yum-downloadonly這個軟體包,請查看附件,下載之後解壓縮,上傳到linux上,進行安裝。

三、使用CentOS的iso搭建本地yum源

#ls /etc/yum.repos.d/#CentOS-Base.repo  CentOS-Media.repo#cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak#vim /etc/yum.repos.d/CentOS-Base.repo      1 [dvd]      2 name=install dvd      3 baseurl=file:///media/CentOS_6.5_Final#iso的掛載路徑      4 enable=1      5 gpgcheck=1#是否對下載的rpm包進行安全檢查      6 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#yum makecache Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfiledvd                                                                                  | 1.1 kB     00:00     dvd/filelists                                                                        | 2.9 MB     00:00     dvd/other                                                                            | 9.1 MB     00:00     dvd/group                                                                            | 920 kB     00:00     dvd/primary                                                                          | 920 kB     00:00     dvd                                                                                               2599/2599dvd                                                                                               2599/2599dvd                                                                                               2599/2599Metadata Cache Created


CentOS yum源配置小技巧

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.