日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

红帽 linux 更换主板,RedHatEnterpriseLinux7更换CentOS7yum源

發布時間:2023/12/8 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 红帽 linux 更换主板,RedHatEnterpriseLinux7更换CentOS7yum源 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

RedHat?yum源是收費的,沒有注冊的Redhat機器是不能使用yum源的。

1、當前系統環境:

系統版本:Red Hat?Enterprise

Linux Server release 7.3 (Maipo)

軟件環境:系統默認是自帶了yum程序的,需要卸載,安裝CentOS的

2、更換yum源:

1) 卸載本地yum:

# rpm -qa|grep yum?#查看本地yum

# rpm -qa|grep yum|xargs rpm -e --nodeps?#卸載本地yum,不檢查依賴性,卸載yum程序

# rpm -qa | grep?Python-urlgrabber | xargs rpm -e

--nodeps

2) 下載CentOS yum程序

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

使用wget命令下載,也可以用瀏覽器下載。rpm包下載地址http://mirrors.163.com/centos/7/os/x86_64/Packages/

,包的版本會有更新,選擇最新版本下載

安裝CentOS yum程序

為避免他們之間互相依賴,三個程序一起安裝

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm

yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

安裝報錯,依賴軟件版本不兼容,

警告:yum-3.4.3-161.el7.centos.noarch.rpm: 頭V3 RSA/SHA256

Signature, 密鑰 ID f4a80eb5: NOKEY?錯誤:依賴檢測失敗:?python-urlgrabber >= 3.10-8 被 yum-3.4.3-161.el7.centos.noarch

需要?rpm >= 0:4.11.3-22 被 yum-3.4.3-161.el7.centos.noarch

需要

重新下載新版本的依賴軟件,安裝更新

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-sign-4.11.3-35.el7.x86_64.rpm

#?wget?http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-4.11.3-35.el7.x86_64.rpm

更新依賴軟件:

# rpm –ivh python-*

# rpm -ivh libxml*

# rpm –Uvh rpm*

再次安裝yum程序

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm

yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

安裝報錯:

錯誤:依賴檢測失敗:?python-urlgrabber >= 3.10-8 被 yum-3.4.3-161.el7.centos.noarch

需要

Python-urlgrabber版本不兼容,下載對應的版本。

#?wget?ftp://ftp.icm.edu.pl/vol/rzm3/linux-centos-altarch/7.5.1804/os/armhfp/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

安裝:

# rpm -ivh

python-urlgrabber-3.10-8.el7.noarch.rpm

再次安裝yum程序

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm

yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

安裝成功。

3) repo 配置文件

下載配置文件

#?cd /etc/yum.repos.d/  #進入到yum配置文件目錄

#?wget

http://mirrors.163.com/.help/CentOS7-Base-163.repo?#下載配置文件

設置配置文件

# sed -i "s;\$releasever;7;g"

CentOS7-Base-163.repo

替換新的repo文件

# mv redhat.repo redhat.repo.bak

配置文件內容如下:

[base]

name=CentOS-7 - Base - 163.com

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

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

gpgcheck=1

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

#released updates

[updates]

name=CentOS-7 - Updates - 163.com

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

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

gpgcheck=1

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

#additional packages that may be useful

[extras]

name=CentOS-7 - Extras - 163.com

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

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

gpgcheck=1

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

#additional packages that extend functionality of existing

packages

[centosplus]

name=CentOS-7 - Plus - 163.com

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

gpgcheck=1

enabled=0

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

更新yum緩存

# yum clean all  #清除yum緩存

# yum makecache?#更新yum緩存

執行yumrepolist查看,如果顯示出repo倉庫列表,并顯示軟件包數量則OK。

#?yum?repolist

至此yum源更換完成。

總結

以上是生活随笔為你收集整理的红帽 linux 更换主板,RedHatEnterpriseLinux7更换CentOS7yum源的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。