首頁 > 軟體

RHEL 6.5 x86_64 設定CentOS yum源

2020-06-16 17:51:36

1、刪除rhel自帶的yum源

# rpm -aq | grep yum|xargs rpm -e --nodeps

2、下載新的yum安裝包

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-3.2.29-69.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

3、安裝yum包,注意的是標紅的必須一起裝,有依賴關係

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

4、更改成163的yum源

# cd /etc/yum.repos.d/

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

# ls
CentOS6-Base-163.repo

把檔案裡面的$releasever全部替換為版本號,即6

# sed -i 's#$releasever#6#g' CentOS6-Base-163.repo

5、清除yum快取

# yum clean all

# 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/2015-10/124023.htm


IT145.com E-mail:sddin#qq.com