RedHat6 使用CentOS yum源

      網(wǎng)友投稿 748 2025-04-05

      簡單介紹下什么是yum:

      Yum(全稱為 Yellow dog Updater, Modified)是一個在Fedora和RedHat以及CentOS中的Shell前端軟件包管理器。基于RPM包管理,能夠從指定的服務(wù)器自動下載RPM包并且安裝,可以自動處理依賴性關(guān)系,并且一次安裝所有依賴的軟件包,無須繁瑣地一次次下載、安裝。

      redhat 系統(tǒng)中,yum是要授權(quán)才能使用的,但幸運地,我們可以將RedHat6使用CentOS的yum源,具體操作如下:

      本文以redhat6.9為例

      login as: root

      root@1.3.1.21's password:

      Last login: Tue Jan 15 15:49:17 2019 from 10.30.6.6? ? ?登錄操作系統(tǒng)

      [root@hrapp2 ~]# rpm -qa |grep yum? ? ? ? ? ? ? ? ?查看已安裝的yum

      yum-3.2.29-81.el6.centos.noarch

      yum-metadata-parser-1.1.2-16.el6.x86_64

      yum-plugin-fastestmirror-1.1.30-41.el6.noarch

      [root@hrapp2 ~]# rpm -qa|grep yum|xargs rpm -e --nodeps? ? ? ??刪除已安裝的redhat yum

      [root@hrapp2 ~]#? rpm -qa |grep yum? ? ? ? ? ? ? ?查看刪除成功

      [root@hrapp2 ~]# wget -c http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm? ?下載centos?yum軟件及工具(共4個)

      --2019-01-17 14:49:27--? http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

      正在解析主機 mirrors.163.com... 59.111.0.251

      正在連接 mirrors.163.com|59.111.0.251|:80... 已連接。

      已發(fā)出 HTTP 請求,正在等待回應(yīng)... 416 Requested Range Not Satisfiable

      文件已下載完成;不會進(jìn)行任何操作。

      [root@hrapp2 ~]#? wget -c http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

      --2019-01-17 14:49:50--? http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

      正在解析主機 mirrors.163.com... 59.111.0.251

      正在連接 mirrors.163.com|59.111.0.251|:80... 已連接。

      已發(fā)出 HTTP 請求,正在等待回應(yīng)... 416 Requested Range Not Satisfiable

      文件已下載完成;不會進(jìn)行任何操作。

      [root@hrapp2 ~]#? wget -c http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

      --2019-01-17 14:50:00--? http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

      正在解析主機 mirrors.163.com... 59.111.0.251

      正在連接 mirrors.163.com|59.111.0.251|:80... 已連接。

      已發(fā)出 HTTP 請求,正在等待回應(yīng)... 416 Requested Range Not Satisfiable

      文件已下載完成;不會進(jìn)行任何操作。

      [root@hrapp2 ~]# wget -c http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

      --2019-01-17 14:50:08--? http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

      正在解析主機 mirrors.163.com... 59.111.0.251

      正在連接 mirrors.163.com|59.111.0.251|:80... 已連接。

      已發(fā)出 HTTP 請求,正在等待回應(yīng)... 416 Requested Range Not Satisfiable

      文件已下載完成;不會進(jìn)行任何操作。

      [root@hrapp2 ~]# ls? ? ? ??查看已經(jīng)下載好的文件

      anaconda-ks.cfg? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 模板

      install.log? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 視頻

      install.log.syslog? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?圖片

      python-iniparse-0.3.1-2.1.el6.noarch.rpm? ? ? ? ? ?文檔

      yum-3.2.29-81.el6.centos.noarch.rpm? ? ? ? ? ? ? ? 下載

      yum-metadata-parser-1.1.2-16.el6.x86_64.rpm? ? ? ? 音樂

      yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm? 桌面

      公共的

      [root@hrapp2 ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm? ??安裝下載好的四個軟件

      warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY

      Preparing...? ? ? ? ? ? ? ? ########################################### [100%]

      package python-iniparse-0.3.1-2.1.el6.noarch is already installed

      [root@hrapp2 ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

      RedHat6 使用CentOS yum源

      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? ? ########################################### [100%]

      [root@hrapp2 ~]# rpm -ivh yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm yum-3.2.29-81.el6.centos.noarch.rpm

      warning: yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

      Preparing...? ? ? ? ? ? ? ? ########################################### [100%]

      1:yum? ? ? ? ? ? ? ? ? ? ########################################### [ 50%]

      2:yum-plugin-fastestmirro########################################### [100%]

      [root@hrapp2 ~]# rpm -qa |grep yum? ? ??查看centos yum軟件已經(jīng)安裝好了

      yum-3.2.29-81.el6.centos.noarch

      yum-metadata-parser-1.1.2-16.el6.x86_64

      yum-plugin-fastestmirror-1.1.30-41.el6.noarch

      [root@hrapp2 ~]# cd /etc/yum.repos.d

      [root@hrapp2 yum.repos.d]#? mkdir bak.lyj.201902? ??新建備份文件夾

      [root@hrapp2 yum.repos.d]# mv *.repo bak.lyj.201902? ??將yum源備份至文件夾

      [root@hrapp2 yum.repos.d]# ls

      bak.lyj.201902

      [root@hrapp2 yum.repos.d]#? wget http://mirrors.163.com/.help/CentOS6-Base-163.repo? ? ??下載centos6的yum源文件

      --2019-01-17 15:09:13--? http://mirrors.163.com/.help/CentOS6-Base-163.repo

      正在解析主機 mirrors.163.com... 59.111.0.251

      正在連接 mirrors.163.com|59.111.0.251|:80... 已連接。

      已發(fā)出 HTTP 請求,正在等待回應(yīng)... 200 OK

      長度:2006 (2.0K) [application/octet-stream]

      正在保存至: “CentOS6-Base-163.repo”

      100%[=======================================================>] 2,006? ? ? ?--.-K/s? ?in 0s

      2019-01-17 15:09:13 (214 MB/s) - 已保存 “CentOS6-Base-163.repo” [2006/2006])

      [root@hrapp2 yum.repos.d]# ls? ? ? ? ? 查看yum源文件已經(jīng)下載好了

      bak.lyj.201902? CentOS6-Base-163.repo

      [root@hrapp2 yum.repos.d]# vim? CentOS7-Base-163.repo? ? ? ? ? ? 編輯yum源文件

      # CentOS-Base.repo

      #

      # The mirror system uses the connecting IP address of the client and the

      # update status of each mirror to pick mirrors that are updated to and

      # geographically close to the client.? You should use this for CentOS updates

      # unless you are manually picking other mirrors.

      #

      # If the mirrorlist= does not work for you, as a fall back you can try the

      # remarked out baseurl= line instead.

      #

      #

      [base]

      name=CentOS-$releasever - Base - 163.com

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

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

      gpgcheck=1

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

      #released updates

      [updates]

      name=CentOS-$releasever - Updates - 163.com

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

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

      gpgcheck=1

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

      #additional packages that may be useful

      [extras]

      name=CentOS-$releasever - Extras - 163.com

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

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

      gpgcheck=1

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

      #additional packages that extend functionality of existing packages

      [centosplus]

      name=CentOS-$releasever - Plus - 163.com

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

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

      gpgcheck=1

      enabled=0

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

      #contrib - packages by Centos Users

      [contrib]

      name=CentOS-$releasever - Contrib - 163.com

      baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/

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

      gpgcheck=1

      enabled=0

      把文件里面的$releasever全部替換為版本號,即6 ,最后保存。

      更改后的文件如下:

      # The mirror system uses the connecting IP address of the client and the

      # update status of each mirror to pick mirrors that are updated to and

      # geographically close to the client.? You should use this for CentOS updates

      # unless you are manually picking other mirrors.

      #

      # If the mirrorlist= does not work for you, as a fall back you can try the

      # remarked out baseurl= line instead.

      #

      #

      [base]

      name=CentOS-$releasever - Base - 163.com

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

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

      gpgcheck=1

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

      #released updates

      [updates]

      name=CentOS-$releasever - Updates - 163.com

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

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

      gpgcheck=1

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

      #additional packages that may be useful

      [extras]

      name=CentOS-$releasever - Extras - 163.com

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

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

      gpgcheck=1

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

      #additional packages that extend functionality of existing packages

      [centosplus]

      name=CentOS-$releasever - Plus - 163.com

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

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

      gpgcheck=1

      enabled=0

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

      #contrib - packages by Centos Users

      [contrib]

      name=CentOS-$releasever - Contrib - 163.com

      baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

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

      gpgcheck=1

      enabled=0

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

      "CentOS6-Base-163.repo" 52L, 1906C

      保存

      [root@hrapp2 yum.repos.d]#? yum clean all? ?清除原有緩存

      已加載插件:fastestmirror, product-id, search-disabled-repos, subscription-manager

      This system is not registered with an entitlement server. You can use subscription-manager to register.

      Cleaning repos: base extras updates

      清理一切

      Cleaning up list of fastest mirrors

      [root@hrapp2 yum.repos.d]#? yum makecache? ?將服務(wù)器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度

      已加載插件:fastestmirror, product-id, search-disabled-repos, subscription-manager

      This system is not registered with an entitlement server. You can use subscription-manager to register.

      Determining fastest mirrors

      base? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| 3.7 kB? ? ?00:00

      base/group_gz? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 242 kB? ? ?00:00

      base/filelists_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 6.4 MB? ? ?00:01

      base/primary_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 4.7 MB? ? ?00:01

      base/other_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 2.8 MB? ? ?00:00

      extras? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| 3.4 kB? ? ?00:00

      extras/filelists_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |? 24 kB? ? ?00:00

      extras/prestodelta? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| 1.1 kB? ? ?00:00

      extras/primary_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |? 27 kB? ? ?00:00

      extras/other_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |? 28 kB? ? ?00:00

      updates? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 3.4 kB? ? ?00:00

      updates/filelists_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| 2.0 MB? ? ?00:00

      updates/prestodelta? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 104 kB? ? ?00:00

      updates/primary_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| 3.0 MB? ? ?00:00

      updates/other_db? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|? 42 MB? ? ?00:14

      元數(shù)據(jù)緩存已建立

      如圖已經(jīng)可以是用centos yum源了

      yum CentOS

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      上一篇:word文檔文字出了頁面是什么情況?(在word2010中整個文檔中文字的顯示)
      下一篇:怎么刪除wps里的分節(jié)符(如何刪掉wps分節(jié)符)
      相關(guān)文章
      风间由美在线亚洲一区| 亚洲成在人天堂在线| 亚洲电影免费观看| 亚洲午夜久久久影院伊人| 老司机亚洲精品影院| 午夜在线亚洲男人午在线| 亚洲天堂男人影院| 亚洲综合伊人制服丝袜美腿| 亚洲精品视频观看| 亚洲视频在线一区| 久久久久亚洲AV无码网站| 久久亚洲精品中文字幕| 亚洲一区二区在线免费观看| 亚洲色四在线视频观看| 亚洲人成网www| 精品日韩亚洲AV无码| 亚洲视频国产视频| 亚洲国产成人va在线观看网址| 亚洲精品日韩专区silk| 亚洲国产精品成人综合色在线婷婷 | 亚洲第一网站男人都懂| 亚洲高清国产拍精品青青草原| 亚洲国产天堂久久久久久| 不卡一卡二卡三亚洲| 亚洲精品tv久久久久久久久| 久久综合日韩亚洲精品色| 亚洲13又紧又嫩又水多| 中文有码亚洲制服av片| 亚洲精品无码久久久久A片苍井空| 亚洲精品宾馆在线精品酒店| 国产精品亚洲一区二区无码| 亚洲伊人久久成综合人影院| 亚洲日产无码中文字幕| 亚洲欧洲日产国码久在线观看 | 亚洲av永久无码一区二区三区| 亚洲AV永久无码精品一福利 | 亚洲毛片av日韩av无码| 亚洲综合伊人久久大杳蕉| 久久亚洲AV午夜福利精品一区| 国产精品亚洲二区在线观看| 亚洲日韩在线第一页|