2021-05-12 14:32:11
RHEL 6.5 X86_64設定CentOS yum源
2020-06-16 17:17:45
1、背景說明
刀鋒伺服器GEN9無法通過引導方式安裝CentOS,只能進行RHEL的安裝。而RHEL上的yum源只能註冊賬戶才能使用,故需要進行yum源替換
2、步驟
1、刪除rhel自帶的yum源 rpm -qa|grep yum|xargs rpm -e --nodeps rpm -qa |grep yum 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 注意:很多網上提供的映象源中所涉及的 yum-3.2.29-69.el6.centos.noarch.rpm此安裝包已經沒有了 mirrors中提供的包為 yum-3.2.29-81.el6.centos.noarch.rpm 如果對次yum安裝包進行下載安裝的話,它會依賴於一些Python的包, python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-81.el6.centos.noarch python版本需要為2.7以上,並不是自帶的版本 所以這裡我單獨去下載了一個就版本,實測是可以的 我使用的版本為:yum-3.2.29-30.el6.noarch.rpm 3、安裝yum包,有依賴關係,三個一起安裝 rpm -ivh yum-3.2.29-30.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm warning: yum-3.2.29-30.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY warning: yum-metadata-parser-1.1.2-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY Preparing... ########################################### [100%] 1:yum-metadata-parser ########################################### [ 33%] 2:yum ########################################### [ 67%] 3:yum-plugin-fastestmirro########################################### [100%] 4、將rhel自帶的yum倉庫檔案移走 yum.repos.d]# mkdir bak yum.repos.d]# mv mirrors-rpmforge* bak/ yum.repos.d]# mv rh* bak/ yum.repos.d]# ls bak epel.repo packagekit-media.repo CentOS6-Base-163.repo epel-testing.repo rpmforge.repo yum.repos.d]# mv packagekit-media.repo bak/ 5、更改163的yum源 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo --2017-04-11 02:23:41-- http://mirrors.163.com/.help/CentOS6-Base-163.repo Resolving mirrors.163.com... 123.58.173.185, 123.58.173.186 Connecting to mirrors.163.com|123.58.173.185|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2006 (2.0K) [application/octet-stream] Saving to: “CentOS6-Base-163.repo” 100%[================================================>] 2,006 --.-K/s in 0s 2017-04-11 02:23:41 (219 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006] 替換$releaserver全部替換為版本號 yum.repos.d]# sed -i 's#$releasever#6#g' CentOS6-Base-163.repo 6、yum倉庫確認 yum.repos.d]# yum repolist Loaded plugins: fastestmirror, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Loading mirror speeds from cached hostfile repo id repo name status base CentOS-6 - Base - 163.com 6,706 extras CentOS-6 - Extras - 163.com 64 updates CentOS-6 - Updates - 163.com 32 repolist: 6,802
更多YUM相關教學見以下內容:
RHEL7 本地yum源設定 http://www.linuxidc.com/Linux/2017-01/139140.htm
CentOS 7 使用阿里雲的yum源、PIP源 http://www.linuxidc.com/Linux/2017-01/13966.htm
CentOS及Red Hat Linux安裝yum源 http://www.linuxidc.com/Linux/2017-02/140205.htm
CentOS 7更改yum源與更新系統 http://www.linuxidc.com/Linux/2017-01/140067.htm
RedHat7.0設定本地yum源 http://www.linuxidc.com/Linux/2017-01/139148.htm
RedHat Linux 7安裝CentOS 7 yum源 http://www.linuxidc.com/Linux/2017-04/142444.htm
軟體包管理之前端管理工具yum http://www.linuxidc.com/Linux/2017-02/140270.htm
CentOS 7 使用阿里雲的yum源、PIP源 http://www.linuxidc.com/Linux/2017-01/13966.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2017-04/142746.htm
相關文章