1. 程式人生 > >redhat配置網路yum源

redhat配置網路yum源

  1. 解除安裝redhat自帶的yum程式及相關軟體包
rpm -qa | grep yum | xargs rpm -e –nodeps
rpm -aq|grep python-iniparse|xargs rpm -e –nodeps

2、下載其他網路源的安裝包,以163的網路源為例,(具體地址可能會發生變化,實際配置時以實際地址為準)

3、安裝下載好的各軟體包

rpm –ivh yum*.rpm
rpm –ivh python*.rpm

4、建立yum配置檔案並寫入相應內容,系統本身的yum配置檔案可存放至其他備份路徑下

vim /etc/yum.repos.d/rhel-debuginfo.repo

檔案內容:

[base]

gpgcheck=1

[update]

name=CentOS-$releasever-update

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[extras]

name=CentOS-$releasever-extras

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

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus]

name=CentOS-$releasever-update

baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

 5、儲存yum配置後文件後測試是否可用,以安裝vsftp為例

yum -y install vsftpd