1. 程式人生 > >rhel源更換為centos源

rhel源更換為centos源

禁用 RHEL 的每個倉庫配置

修改目錄 /etc/yum.repos.d  下每個檔案,將 enable=1 改為 enable=0,或者也可以將這個目錄清空

建立 CentOS 的配置 /etc/yum.repos.d/centos.repo ,內容為:

[CentOS5 base]
name=CentOS-5-Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[CentOS5 updates]
name=CentOS-5-Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[CentOS5plus]
name=CentOS-5-Plus
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

這些倉庫需要 GPG 驗證,還需要把公鑰複製下來。 或者也可以將 centos.repo 中 gpgcheck=1 改為 gpgcheck=0 來避免驗證:
rpm --import http://isoredirect.centos.org/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

測試是否可用 [plain] view plaincopyprint?在CODE上檢視程式碼片派生到我的程式碼片
  1. # yum list available  
  2. Loaded plugins: product-id, refresh-packagekit, security, subscription-manager  
  3. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.  
  4. Bad id for repo: CentOS5 base, byte =   7  
  5. Bad id for repo: CentOS5 updates, byte =   7  

上面的倉庫地址是在 這裡 找到的,因為 倉庫 ID 帶了空格造成 錯誤 Bad id for repo: CentOS5 base, byte =   7,去掉空格就可以了

Bad id 說的就是 repo 檔案中方括號中的 倉庫 ID, byte = 7 為引起錯誤的地方

對於 “This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register” 問題

可在使用 yum 時禁用相應外掛,如:

[plain] view plaincopyprint?在CODE上檢視程式碼片派生到我的程式碼片
  1. yum --disableplugin=subscription-manager list available  

或 將 /etc/yumconf 中 plugins=1 改為 plugins=0 來禁用所有外掛

也可以禁用指定外掛,在 /etc/yum/pluginconf.d 下找到外掛對應的檔案 ,如要禁用 subscription-manager 外掛,修改 /etc/yum/pluginconf.d/subscription-manager.conf 檔案

將 enabled=1 改為 enabled=0 即可

如果要得到更好的支援,可以把 CentOS 的 Release Node : centos-release 和 centos-release-notes 安裝上

wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm yum install epel-release-7-1.noarch.rpm

或者用 rpm -ivh epel-release-7-1.noarch.rpm 安裝

檢視是否安裝成功:

yum repolist

二、redhat配置centos源

vi /etc/yum.repos.d/CentOS-Base.repo

[base]

name=CentOS-5-Base

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

baseurl=http://ftp.sjtu.edu.cn/centos/7/os/$basearch/

gpgcheck=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

#released updates

[updates]

name=CentOS-$releasever – Updates

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

baseurl=http://ftp.sjtu.edu.cn/centos/7/updates/$basearch/

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]

name=CentOS-$releasever – Extras

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

baseurl=http://ftp.sjtu.edu.cn/centos/7/extras/$basearch/

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

b[centosplus]

name=CentOS-$releasever – Plus

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

baseurl=http://ftp.sjtu.edu.cn/centos/7/centosplus/$basearch/

gpgcheck=0

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 rpm -qa gpg-pubkey

1 刪除rhel自帶的yum包:

  1. rpm -aq | grep yum |xargs rpm -e --nodeps

2 安裝yum:

  1. [china~/yum_64#]rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
  2. warning:python-iniparse-0.3.1-2.1.el6.noarch.rpm:Header V3 RSA/SHA256 Signature, keyID c105b9de: NOKEY
  3. Preparing...########################################### [100%]
  4. packagepython-iniparse-0.3.1-2.1.el6.noarch is already installed
  5. [china~/yum_64#]rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
  6. warning:yum-metadata-parser-1.1.2-16.el6.x86_64.rpm:Header V3 RSA/SHA1 Signature, keyID c105b9de: NOKEY
  7. Preparing...########################################### [100%]
  8. 1:yum-metadata-parser    ###########################################[100%]
  9. [china~/yum_64#]rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
  10. warning:yum-3.2.29-40.el6.centos.noarch.rpm:Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
  11. Preparing...########################################### [100%]
  12. 1:yum-plugin-fastestmirro########################################### [50%]
  13. 2:yum                   ########################################### [100%]
  14. [ichina~/yum_64#]

若提示需要依賴

  1. libc.so.6is neededby yum-metadata-parser-1.1.2-16.el6.i686
  2. libc.so.6(GLIBC_2.0)is needed by yum-metadata-parser-1.1.2-16.el6.i686
  3. libc.so.6(GLIBC_2.1.3)is needed by yum-metadata-parser-1.1.2-16.el6.i686
  4. libglib-2.0.so.0is needed by yum-metadata-parser-1.1.2-16.el6.i686
  5. libpthread.so.0is needed by yum-metadata-parser-1.1.2-16.el6.i686
  6. libpython2.6.so.1.0is needed by yum-metadata-parser-1.1.2-16.el6.i686
  7. libsqlite3.so.0is needed by yum-metadata-parser-1.1.2-16.el6.i686
  8. libxml2.so.2is needed by yum-metadata-parser-1.1.2-16.el6.i686
  9. libxml2.so.2(LIBXML2_2.4.30)is needed by yum-metadata-parser-1.1.2-16.el6.i686

3 新增網易163的yum源

獲取檔案:CentOS6-Base-163.repo

  1. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
  2. cp CentOS-Base-163.repo rhel-source.repo
  3. sed -i 's/\$releasever/6/g' rhel-source.repo

4 清空 yum 快取

  1. yum clean all

5 將伺服器上的軟體包資訊快取到本地

提高yum的更新效率

  1. yum makecache

相關推薦

rhel更換centos

禁用 RHEL 的每個倉庫配置 修改目錄 /etc/yum.repos.d  下每個檔案,將 enable=1 改為 enable=0,或者也可以將這個目錄清空 建立 CentOS 的配置 /etc/yum.repos.d/centos.repo ,內容為: [CentOS

centos將yum更換阿里

一、確定機器可以連線到網路(ping www.baidu.com) 二、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 三、從網上下載新的原始檔(我的centos為6.7版本

RHEL7更換CentOS

在網上下載或在CentOS映象中(Packages目錄下)找到下列安裝包並安裝 yum-3.4.3-118.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-

rhel伺服器改centos

# cd /etc/yum.repos.d/ # wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo # vi CentOS6-Base-163.repo  #編輯檔案  把檔案裡面的$releasever全部替換

centos下將系統預置yum更換阿裏雲

image 更換 make cnblogs log alt ima -1 ase 參考:http://mirrors.aliyun.com/help/centos?spm=5176.bbsr150321.0.0.d6ykiD 步驟1:備份 步驟2:更新CentOS-Bas

Centos的yum更換國內的阿裏雲

.com blank 新的 back help ack centos 7 mir 備份 1、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下載新的Ce

Centos的yum更換國內的阿裏雲

p s yun 高速 系統 AR ext 推出 yum 運行 阿裏雲Linux安裝軟件鏡像源 阿裏雲是最近新出的一個鏡像源。得益與阿裏雲的高速發展,這麽大的需求,肯定會推出自己的鏡像源。阿裏雲Linux安裝鏡像源地址:http://mirrors.aliyun.com/ C

超簡單將Centos的yum更換國內的阿裏雲

lan AC aliyun href 國內 下載 阿裏雲 target 1.0 自己的yum源不知道什麽時候給改毀了……搜到了個超簡單的方法將yum源更換為阿裏的源 完全參考 http://mirrors.aliyun.com/help/centos?spm=5176.

[CentOS7.5]Centos的yum更換國內的阿里雲

1、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/ CentOS 5

超簡單將Centos的yum更換國內的阿里雲

自己的yum源不知道什麼時候給改毀了……搜到了個超簡單的方法將yum源更換為阿里的源 完全參考 1、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、

Ubuntu 更換國內

Ubuntu系統自帶的源都是國外的網址,國內使用者在使用的時候網速容易比較慢,所以下面介紹如何將國外源更換為國內源: 將原先的源備份一下 sudo cp /etc/apt/sources.list /etc/apt/sources_init.list 更換源 s

red hat的yum修改centos的yum

redhat預設自帶的yum源需要註冊付費才能更新,而centos的yum源是免費的,為了使用方便我們把red hat的yum源改成centos的網易的yum源。 1、解除安裝red hat的yum

CentOS的yum更換成阿里

因為個人需要,整理的 參考:https://blog.csdn.net/chavo0/article/details/51939362 1.備份 $ mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.r

將Homebrew的更換清華大學提供的

預設的Homebrew的源會經常遇到被Q,或者網路問題導致下載速度非常慢,於是就需要將源更換為國內的源,本次我是將原來的源替換為清華大學的源。cd "$(brew --repo)" cp -a .git .git_bak git remote set-url origin https://mirrors.tu

ubuntu16.04更換國內

重灌系統時沒有安裝好語言,後來安裝時都是從國外官方下載速度非常慢,所以換成了中間節點阿里源等進行下載,速度明顯提升。 方法: 修改/etc/apt/sources.list檔案 切換到apt目錄下:cd  /etc/apt/ 修改前可以先對檔案進行備份,以便日後恢

使用CocoaPods做依賴管理(淘寶更換HTTPS)--轉自 唐巧技術部落格

CocoaPods 簡介 每種語言發展到一個階段,就會出現相應的依賴管理工具,例如 Java 語言的 Maven,nodejs 的 npm。隨著 iOS 開發者的增多,業界也出現了為 iOS 程式提供依賴管理的工具,它的名字叫做:CocoaPods。 CocoaPod

CentOS配置:將預設yum更改163或阿里雲

原因 CentOS預設的yum源可能不是國內映象源,導致使用yum進行線上安裝及更新時,速度不是很理想。此時需要將yum源設定為國內映象源。國內的開源映象站點主要有網易和阿里雲。 配置過程 首先備份系統自帶的yum源配置檔案/etc/yum.repo

Docker學習筆記_下載鏡像更換國內,實現快速下載image

art com mon iyu http image .cn 內容 mirrors 1、編輯/etc/docker/daemon.json,增加下面內容: { "registry-mirrors": ["https://registry.docker-cn.com"] }

CentOS7 中把yum更換成163

CentOS7 中把yum源更換成163源 2018年01月25日 13:45:43 Fresh-eyes 閱讀數:3853更多 個人分類: linux         CentOS預設yum源是國外的, 速度無法保證

maven專案的阿里

找到MyElipse -> Window-> Preferences ->Myeclipse -> Maven4MyEclipse ->User Settings  找到 setting.xml 的位置開啟檔案 在標籤<mirrors&g