2021-05-12 14:32:11
RedHat6.5更換CentOS源
1. 刪除自帶的源
rpm -aq | grep yum|xargs rpm -e –nodeps
2. 下載源
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-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
3. 安裝
rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
若出現以下錯誤。則說明python-urlgrabber版本有問題。
4.python-urlgrabber版本更改
(1) 檢視系統的python資訊
rpm -qa|grep python
(2) 查詢結果中python-urlgrabber-[版本號].el6.noarch,若版本號小於3.9.1-10。則繼續執行以下步驟。
(3) 解除安裝python-urlgrabber
rpm -e python-urlgrabber-[版本號].el6.noarch
(4) 下載python-urlgrabber
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
(5) 安裝
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
5. 更改組態檔
(1)進入到/etc/yum.repos.d/資料夾中
(2) 下載組態檔
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
(3)編輯組態檔
vim CentOS6-Base-163.repo
把$releasever替換成現有系統的版本號“6”
:%s/$releasever/6/g
6. 清理yum快取
yum clean all
7. 把伺服器軟體包資訊快取到本地,提高效率
yum makecache
更多YUM相關教學見以下內容:
RedHat 6.2 Linux修改yum源免費使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm
設定EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm
Redhat 本地yum源設定 http://www.linuxidc.com/Linux/2012-11/75127.htm
yum的組態檔說明 http://www.linuxidc.com/Linux/2013-04/83298.htm
RedHat 6.1下安裝yum(圖文) http://www.linuxidc.com/Linux/2013-06/86535.htm
YUM 安裝及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm
CentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2016-11/136957.htm
相關文章