本文的配置是基于Linux系統(tǒng):Redhat 6.4 Server 32位系統(tǒng),如有需要可以在百度搜索關(guān)鍵字“[紅帽企業(yè)Linux.6.4.服務(wù)器版].rhel-server-6.4-i386-dvd[ED2000.COM].iso”下載 本文中很多命令的執(zhí)行都需要使用root權(quán)限,使用root權(quán)限的方法有兩種 1.切換到root用戶(hù)下,執(zhí)行命令su,并輸入密碼 2.將當(dāng)前用戶(hù)增加到文件 /etc/sudoers 文件中,在 “root ALL=(ALL) ALL” 之后加入 “當(dāng)前用戶(hù)名 ALL=(ALL) ALL” 配置需要簡(jiǎn)單的幾步:
一、卸載系統(tǒng)自帶的yum軟件包root用戶(hù)執(zhí)行如下命令: sudo rpm -aq|grep yum|xargs rpm -e --nodeps 二、安裝網(wǎng)易163開(kāi)源的yum軟件包1.下載軟件包 wget mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpm wget mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm wget mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm 注意:上面的軟件包都是32位系統(tǒng)使用的,如果你的操作系統(tǒng)是64位的,請(qǐng)去網(wǎng)易開(kāi)源庫(kù)下載相應(yīng)的軟件包:下載地址 2.安裝軟件包切換到root用戶(hù)下,依次執(zhí)行如下命令 rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm 最后兩個(gè)包需要同時(shí)安裝,需要相互依賴(lài)三、備份原來(lái)的yum源配置文件root用戶(hù)下執(zhí)行如下命令: mv /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.bak 四、創(chuàng)建新的yum源配置文件創(chuàng)建配置文件: vim /etc/yum.repos.d/rhel-source.repo 將如下內(nèi)容粘貼到該文件中(使用網(wǎng)易163的yum源): [base]name=CentOS-$releasever - Basebaseurl=http://mirrors.163.com/centos/6.7/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6#released updates[updates]name=CentOS-$releasever - Updatesbaseurl=http://mirrors.163.com/centos/6.7/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6#packages used/produced in the build but not released#[addons]#name=CentOS-$releasever - Addons#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/#gpgcheck=1#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasbaseurl=http://mirrors.163.com/centos/6.7/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusbaseurl=http://mirrors.163.com/centos/6.7/centosplus/$basearch/gpgcheck=1enabled=0 五、清理yum緩存執(zhí)行如下命令: yum clean all 六、成功測(cè)試: sudo yum install vim 本文在文章http://blog./25313300/viewspace-708509/的基礎(chǔ)上加工而成,原文章的一些配置已經(jīng)無(wú)效,請(qǐng)使用本篇文章的配置。 |
|