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

歡迎訪問 生活随笔!

生活随笔

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

centos

Centos添加其他yum源

發布時間:2025/3/13 centos 73 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Centos添加其他yum源 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、安裝CentOS?yum源優先級插件yum-priorities

yum?install?yum-priorities???#輸入y安裝

二、設置CentOS默認yum源的優先級為最高

cd??/etc/yum.repos.d/???#進入yum源目錄

vi?CentOS-Base.repo???#[base][updates][extras]組下面添加priority=1,在[centosplus][contrib]組下面添加priority=2 ???結果如下:

################################################################

[base]

name=CentOS-$releasever?-?Base

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

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

gpgcheck=1

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

priority=1

?

[updates]

name=CentOS-$releasever?-?Updates

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

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

gpgcheck=1

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

priority=1

?

[extras]

name=CentOS-$releasever?-?Extras

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

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

gpgcheck=1

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

priority=1

?

[centosplus]

name=CentOS-$releasever?-?Plus

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

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

gpgcheck=1

enabled=0

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

priority=2

?

[contrib]

name=CentOS-$releasever?-?Contrib

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

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

gpgcheck=1

enabled=0

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

priority=2

###############################################################

?

?

備注:priority的優先級為199,設置為1即優先級最高,1-10為系統保留,第三方yum源的優先級從11-99

三、安裝epel?yum(轉載自http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x?

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm



然后 ???vi ???/etc/yum.repos.d/epel.repo ??將其優先級設置為11

?

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

priority=11



[epel-debuginfo]

name=Extra Packages for Enterprise Linux 6 - $basearch - Debug

#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch

failovermethod=priority

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

gpgcheck=1

priority=11



[epel-source]

name=Extra Packages for Enterprise Linux 6 - $basearch - Source

#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch

failovermethod=priority

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

gpgcheck=1



priority=11

?

?

四:安裝remi源:

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

導入key

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi

更改優先級:?

vi /etc/yum.repos.d/remi.repo?

如下將優先級設置為?12 ??

[remi]

name=Les RPM de remi pour Enterprise Linux 6 - $basearch

#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/

mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror

enabled=0

gpgcheck=1

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

priority=12



[remi-test]

name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch

#baseurl=http://rpms.famillecollet.com/enterprise/6/test/$basearch/

mirrorlist=http://rpms.famillecollet.com/enterprise/6/test/mirror

enabled=0

gpgcheck=1

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



priority=12





[remi-debuginfo]

name=Les RPM de remi pour Enterprise Linux 6 - $basearch - debuginfo

baseurl=http://rpms.famillecollet.com/enterprise/6/debug-remi/$basearch/

enabled=0

gpgcheck=1

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



[remi-test-debuginfo]

name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch - debuginfo

baseurl=http://rpms.famillecollet.com/enterprise/6/debug-test/$basearch/

enabled=0

gpgcheck=1

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

priority=12

?

?

nux源

http://li.nux.ro/repos.html

轉載于:https://www.cnblogs.com/jiahu-Blog/p/3527422.html

總結

以上是生活随笔為你收集整理的Centos添加其他yum源的全部內容,希望文章能夠幫你解決所遇到的問題。

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