为centos添加第三方源

默认centos自带的源少了很多好软件,所以需要添加第三方源
一、安装CentOS yum源优先级插件yum-priorities
yum install yum-plugin-priorities.noarch
二、设置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的优先级为1到99,设置为1即优先级最高,1-10为系统保留,第三方yum源的优先级从11-99

三、安装epel yum源
    rpm -ivh  http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
    vi /etc/yum.repos.d/epel.repo   #修改epel yum源优先级,priority=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
#################################################################

四、安装rpmforge yum源
   wget http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
   wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
   rpm --import RPM-GPG-KEY.dag.txt
   rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
   vi  /etc/yum.repos.d/rpmforge.repo  #修改rpmforge yum源优先级,priority=12
 
#################################################################
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=12
#################################################################

五、安装rpmfusion yum源
   rpm -ivh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm
   vi  /etc/yum.repos.d/rpmfusion-free-updates-testing.repo   #修改rpmfusion yum源优先级,priority=13
 
#################################################################
[rpmfusion-free-updates-testing]
name=RPM Fusion for EL 6 - Free - Test Updates
#baseurl=http://download1.rpmfusion.org/free/el/updates/testing/6/$basearch/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-testing-6&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
priority=13
系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
#################################################################
六、安装atomic yum源
    wget http://www.atomicorp.com/installers/atomic  #下载
    sh ./atomic   #安装
    vi  /etc/yum.repos.d/atomic.repo  #修改atomic yum源优先级,priority=14
##############################################################
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-6-$basearch
#mirrorlist = http://www.atomicorp.com/channels/atomic/centos/6/mirrors-atomic
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1
priority=14
##############################################################
七、更新yum软件包
       yum check-update

时间: 2024-09-30 19:10:55

为centos添加第三方源的相关文章

centos添加epel源

1. rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm    粗体部分需要根据自己的的环境自行选择 2. rpm -import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL 这步可做可不做(因为用yum安装软件的时候根据提示选择y可以自动导入) 3. 修改/etc/yum.repos.d/epel.repo文件,在[epel]最后添加一条属性 priorit

CentOS添加本地源

1.将CentOS的Everything镜像文件复制到 /usr/local/src目录下 2.添加 /etc/yum.repos.d/localSource.repo ,文件内容如下: [localSource] name=localSource baseurl=file:///mnt/localSource enable=1 gpgcheck=0 3.打开/etc/fstab文件,加入: /usr/local/src/CentOS-7.0-1406-x86_64-Everything.iso

给centOs添加epel源

epel简介: https://fedoraproject.org/wiki/EPEL/zh-cn 1. rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm    粗体部分需要根据自己的的环境自行选择 2. rpm -import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL 这步可做可不做(因为用yum安装软件的时候根据提示选择y可以自动导入) 3. 修改/e

CentOS添加163源

1.备份/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份) wget http://mirrors.163.com/.help/CentOS7-Base-163.repomv  CentOS7-Base-163.repo /etc/yum.

centos下添加epel源

RHEL以及他的衍生发行版如CentOS.Scientific Linux为了稳定,官方的rpm repository提供的rpm包往往是很滞后的,当然了,这样做这是无可厚非的,毕竟这是服务器版本,安全稳定是重点,官方的rpm repository提供的rpm包也不够丰富,很多时候需要自己编译那太辛苦了,而EPEL恰恰可以解决这两方面的问题. 什么是EPEL? EPEL的全称叫 Extra Packages for Enterprise Linux .EPEL是由 Fedora 社区打造,为 R

刚安装好CentOS 7,安装gtk3、codeblocks、chrome、添加常用源、代替迅雷的qbittorrent

1. 安装gtk3 正想学习gtk,随便装上 安装gtk3.0 yum -y install gtk3-devel gtk3-devel-docs 2. 安装codeblocks 用贯了codeblocks,先安装codeblocks开发环境 在Fedora好像可以直接yum install codeblocks安装,在centos要先装wxGTK,因为codeblocks依赖于它 安装wxGTK yum -y install wxGTK 安装codeblock (这样安装的好像是13.12版本

CentOS 添加常用 yum 源

CentOS 的官方源去掉了一些与版权有关的软件,因此想要安装这些软件或者手动下载安装,或者使用其他源. 下面我推荐常用的两个源, 这两个源基本可以满足一般服务器的使用需求. 首先, 添加源之前要确定系统架构及版本. 查看系统版本: Shell 1 lsb_release -a 此命令大部分主机上已安装, 会得到如下显示:LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distri

CentOS 添加常用 yum 源(转)

CentOS 的官方源去掉了一些与版权有关的软件,因此想要安装这些软件或者手动下载安装,或者使用其他源. 下面我推荐常用的两个源, 这两个源基本可以满足一般服务器的使用需求. 首先, 添加源之前要确定系统架构及版本. 查看系统版本: Shell 1 lsb_release   -a 此命令大部分主机上已安装, 会得到如下显示:LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Dist

CentOS 添加 Oracle YUM 源

文章来自:Oracle 官方 YUM 源 Introduction The Oracle public yum server offers a free and convenient way to install the latest Oracle Linux packages as well as packages from the Oracle VM installation media via a yum client. You can download the full Oracle L