標籤:http io ar os 使用 sp on 檔案 bs
在沒有光碟片的情況,需要安裝軟體包,就要用到共網的yum源來安裝了。
RedHat linux 預設是安裝了yum軟體的,但是由於啟用認證的原因讓redhat無法直接進行yum安裝一些軟體,如果我們需要在redhat下直接yum安裝軟體,我們只用把yum的源修改成CentOS的就好了,然後把源裡面的變數全部修改成實際的值,這樣就能使用yum直接安裝我們需要的軟體了。
使用說明
1、到http://mirrors.163.com的 centos協助文檔 中下載CentOS6-Base-163.repo檔案,存放到/etc/yum.repo.d中
Centos 5 wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
Centos 6 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
操作如下:
2、首先備份/etc/yum.repos.d/CentOS-Base.repo
3、編輯CentOS6-Base-163.repo檔案,將其中的$releasever更改為centos的版本號碼,如果是RedHat 6.2 X86_64為例“baseurl=http://mirrors.163.com/centos/6.2/os/x86_64/”,本文檔是以RedHat 6.2 32位為例所寫!
[base]
name=CentOS-6.2 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6.2/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6.2
#released updates
[updates]
name=CentOS-6.2 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.2/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6.2
#additional packages that may be useful
[extras]
name=CentOS-6.2 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.2/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6.2
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 .2- Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.2/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6.2
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.2 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.2/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6.2
編輯完後儲存,運行:
yum clean all 清除原有緩衝
yum makecache 擷取yum列表
(轉)Linux修改yum源免費使用CentOS源