redhat 6.8 配置yum源


一般安裝好redhat后,不能注冊的話,不能使用系統自帶的yum源。但是我們可以自己配置yum源來解決這一問題。下面介紹下redhat配置163yum源。

 

1. 檢查是否安裝yum包

rpm -qa |grep yum

 

2. 刪除自帶的yum包

rpm -qa|grep yum|xargs rpm -e --nodeps

因為一些包之間可能會有依賴關系,所以我們需要加上參數 --nodeps 無視依賴關系。

 

3. 下載yum包

Yum包下載地址http://mirrors.163.com/centos/

在這個網站里,你可以自己選擇需要下載的文件,進入形如5/或者6/的文件下載,其他的無法下載。  (rpm 版本會更新)

   wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm 

 

4. 解壓yum包

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

 

5. 替換yum源

cd  /etc/yum.repos.d/

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

vi CentOS6-Base-163.repo

注意原來的yum源配置文件是rhel-source.repo。這里把CentOS6-Base-163.repo替換掉rhel-source.repo。

mv rhel-source.repo rhel-source.repo.bak
mv CentOS6-Base-163.repo rhel-source.repo

 

6. 編輯替換后的rhel-source.repo。

#rhel-source.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-6 - Base - 163.com

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

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

gpgcheck=1

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

 

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

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

#mirrorlist=http://mirrorlist.centos.org/?release=6&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-6 - Extras - 163.com

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

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

gpgcheck=1

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

 

7. 清理並重建緩存

yum clean all
yum makecache

 

8. 更新yum

yum update

 

至此,redhat配置163yum源完成

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM