星空网 > 软件开发 > 操作系统

Linux yum源完全配置

一、简介

yum主要功能是更方便的添加/删除/更新RPM包,自动解决包的依赖性问题,便于管理大量系统的更新问题,其理念是使用一个中心仓库(repository)管理一部分甚至一个distribution的应用程序相互关系,根据计算出来的软件依赖关系进行相关的升级、安装、 删除等操作,减少了Linux用户一直头痛的dependencies的问题。 可以同时配置多个资源库(Repository),简洁的配置文件(/etc/yum.conf),自动解决增加或删除rpm包时遇到的依赖性问题,保持与RPM数据库的一致性。

 

二、软件安装方法及策略

http://seisman.info/how-to-install-softwares-under-centos-7.html

 

三、官方源

配置CentOS6官方源,步骤如下:

1)执行如下命令,查看yum包

rpm -qa|grep yum

2)执行如下命令,卸载原有源

rpm -qa | grep yum | xargs rpm -e --nodeps

3)下载新的yum包

wget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-3.2.29-22.el6.centos.noarch.rpmwget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm wget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm

4)执行如下命令,安装新的yum包

rpm -ivh yum-*

5)下载yum的配置源

wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

修改配置源,修改后的链接如下:

http://download.csdn.net/detail/u011640816/9252933

6)执行如下指令,进行统一更新

cd /etc/yum.repos.d/yum update

 

 

四、第三方源

CentOS/RHEL默认的yum软件仓库非常有限,仅仅限于发行版本那几张盘里面的常规包和一些软件包的更新,利用RpmForge,可以增加非常多的第三方rpm软件包. RpmForge库现在已经拥有超过10000种CentOS的软件包,被CentOS社区认为是最安全也是最稳定的一个第三方软件库.

 

步骤如下:

1、安装yum-priorities插件
     这个插件是用来设置yum在调用软件源时的顺序的. 因为官方提供的软件源,都是比较稳定和被推荐使用的. 因此,官方源的顺序要高于第三方源的顺序. 如何保证这个顺序,就需要安装yum-priorities这插件了.

# yum -y install yum-priorities

 

2、安装完yum-priorities插件后,需要设置/etc/yum.repos.d/ 目录下的.repo相关文件(如CentOS-Base.repo),在这些文件中插入顺序指令:priority=N (N为1到99的正整数,数值越小越优先)
一般配置[base],[addons],[updates],[extras]的priority=1,[CentOSplus],[contrib]的priority=2,其他第三的软件源为:priority=N (推荐N>10),以CentOS-Base.repo 为例:

##############################################################[base]name=CentOS-$releasever - Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osbaseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6priority=1##############################################################

 

3、adobe软件仓

 

1、添加adobe软件仓并导入密钥

# rpm -ivh http://linuxdownload.adobe.com/linux/i386/adobe-release-i386-1.0-1.noarch.rpm     #32位# rpm -ivh http://linuxdownload.adobe.com/linux/x86_64/adobe-release-x86_64-1.0-1.noarch.rpm   #64位# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux    #导入密钥

2、设置/etc/yum.repos.d/中的adobe-linux-x86_64.repo中的priority=10

 

现在可以安装adobe的flashplayer插件了

# yum install flash-plugin

 

4、atomic软件仓

 

1、安装atomic源

# wget http://www.atomicorp.com/installers/atomic #下载# sh ./atomic  #安装

 

2、设置/etc/yum.repos.d/中的atomic.repo中的priority=11

##############################################################[atomic]name=CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.commirrorlist=http://www.atomicorp.com/mirrorlist/atomic/centos-6-$basearch#mirrorlist=http://www.atomicorp.com/channels/atomic/centos/6/mirrors-atomicenabled=1protect=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txtpriority=11##############################################################

 

5、epel软件仓

 

1、安装epel yum源

CentOS 532位系统:# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
64位系统:# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
导入key: # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5CentOS 632位系统:# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
64位系统:# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
导入key: # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

 

2、设置/etc/yum.repos.d/中的epel.repo中的priority=12

提示:如果用比较新的软件,用epel-test.repo这个文件就行了

###############################################################[epel]name=Extra Packages for Enterprise Linux 6 - $basearch#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6priority=12#################################################################

 

6、rpmforge软件仓

 

1、安装rpmforge软件源

# wget http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm   #32位# wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm #64位# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt #2安装DAG的PGP Key# rpm --import /etc/pki/rpm-gpg/* #导入本地的key# rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm  #验证rpmforge的rpm文件包# rpm -i rpmforge-release-0.5.3-1.el6.rf.i386.rpm #安装rpmforge的rpm文件包

 

2、设置/etc/yum.repos.d/rpmforge.repo文件中源的级别,priority=13

########################################################### Name: RPMforge RPM Repository for RHEL 6 - dag### URL: http://rpmforge.net/[rpmforge]name=RHEL $releasever - RPMforge.net - dagbaseurl=http://apt.sw.be/redhat/el6/en/$basearch/rpmforgemirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge#mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforgeenabled=1protect=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-daggpgcheck=1priority=13########################################################

 

7、rpmfusion软件仓

rpmfusion主要为桌面发行版提供大量rpm包,而EPEL则为服务器版本提供大量的rpm包,而且大多数rpm包在官方repository中是找不到的

 

1、安装rpmfusion yum源

32位# rpm -ivh http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
# rpm -ivh http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm
64位# rpm -ivh http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm
# rpm -ivh http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm

 

2、设置/etc/yum.repos.d/rpmfusion-free-updates.repo文件中源的级别,priority=14

#################################################################[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=$basearchenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6priority=14#################################################################

 

8、Percona软件仓

 

1、安装Percona yum源

rpm –ivh http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpmrpm --import http://www.percona.com/downloads/percona-release/RPM-GPG-KEY-percona

 

2、设置/etc/yum.repos.d/Percona .repo文件中源的级别,priority=15

[percona]name = CentOS $releasever - Perconabaseurl=http://repo.percona.com/centos/7/os/$basearch/                                  enabled = 1gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-perconagpgcheck = 1priority=15

 

9、安装完毕后执行如下命令,就可以使用新的yum源管理软件了。

# yum clean all# yum makecache

 

 

9、163软件仓

 

1、安装163 yum源

rpm -ivh http://mirrors.163.com/.help/CentOS6-Base-163.reporpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

2、设置/etc/yum.repos.d/CentOS6-Base-163.repo文件中源的级别,priority=16

[base]name=CentOS-$releasever - Base - 163.combaseurl=http://mirrors.163.com/centos/7/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7priority=16

 

五、创建本地软件库

http://www.cnblogs.com/xiaoluo501395377/archive/2013/05/21/3089970.html

 

 

参考:http://www.linuxdiyf.com/bbs/thread-423690-1-1.html




原标题:Linux yum源完全配置

关键词:linux

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

观察 | “可持续性”话题正盛,中国快时尚品牌如何稳健出海:https://www.kjdsnews.com/a/778463.html
2022年航运市场前瞻:到货慢、价格高,美国现状最糟糕:https://www.kjdsnews.com/a/778464.html
2022年,掘金东南亚,你准备好了吗?:https://www.kjdsnews.com/a/778465.html
抢占先机!冬奥吉祥物“冰墩墩”席卷海内外!:https://www.kjdsnews.com/a/778466.html
精准挖掘关键词,店铺流量轻松拿捏!:https://www.kjdsnews.com/a/778467.html
跨境电商今年还有黑科技吗?2022跨境电商该如何运营:https://www.kjdsnews.com/a/778468.html
恐怖游轮2002 恐怖游轮2022:https://www.vstour.cn/a/365178.html
时尚电商平台Meesho拟融资3亿美元!:https://www.kjdsnews.com/a/1836524.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流