今天把 CentOS 裝了起來 ... 即將開始要亂槍打鳥的學習方式了 XD

參考此篇文章來說,所謂的 YUM 就是 Yellowdog Updater Modified,有一點點像 FreeBSD 裡的 Ports 這東東,簡單來說就是可以輕鬆的來管理軟體的工具。

要使用 YUM 必須做一些設定。預設在 /etc/yum.conf 裡面就可以做設定,不過  yum.conf 也有提到,若沒有在裡面做任何配置,它就會自動去尋找 /etc/yum.repos.d/ 裡面的 CentOS-Base.repo 這個檔案。因此我們要針對此檔案做一些調校。

# cd /etc/yum.repos.d
# cp CentOS-Base.repo CentOS-Base.default
# vi CentOS-Base.repo

直接打入下面這行,並存檔離開 ( 進入 vi 後按 Esc )
:%s/mirror.centos.org\/centos/ftp.cse.yzu.edu.tw\/pub\/CentOS

:%s/mirror.centos.org\/centos/ftp.cs.pu.edu.tw\/Linux\/CentOS

:%s/mirror.centos.org\/centos/ftp2.tnc.edu.tw\/pub1\/CentOS
另外,我們在安裝一些要用到的一些工具時,或許它並不存在於 CentOS yum 的官方資料庫中。所以我們還要另外定義非官方資料庫文件,讓一些實用的工具也能透過 yum 來安裝。
# vi /etc/yum.repos.d/dag.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

匯入非官方資料庫的GPG
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
這樣子就可以了!
arrow
arrow
    全站熱搜

    Bojack 發表在 痞客邦 留言(0) 人氣()