Logo

[CentOS]安装第三方套件加强YUM功能

YUM是个很好用的套件管理员,但是版本不一定会是最新也就不会是最安全,所以利用第三方套件来加强YUM的功能吧! ?
加速YUM套件升级
YUM默认是运用镜像站来下载更新,这边要做的是不寻找镜像站,而直接指定到哪个镜像站来下载套件。
编辑CentOS-Base.repo里面的baseurl位置到CentOS各国的镜像站,这边选的是中华电信~
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vi /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[update] name=CentOS-$releasever – Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
[addons] name=CentOS-$releasever – Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras] name=CentOS-$releasever – Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus] name=CentOS-$releasever – Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib – packages by Centos Users
[contrib] name=CentOS-$releasever – Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
所以只要先注释掉mirrorlist再把http://mirror01.idc.hinet.net/CentOS/换上其他各国镜像站的网址来符合你主机的所在位置就会很快! ?
台湾 前三个都超快的~ 挑一个离自己近的用囉! ?
中华电信 IDC HTTP FTP
中山大学 HTTP
交通大学 HTTP FTP
树德科技大学 HTTP FTP
静宜大学 HTTP FTP
台中县教育网络中心 HTTP FTP Direct DVD
元智大学 HTTP FTP Direct DVD
老美
Facebook (Palo Alto, CA) HTTP // 没看错~ 真的是灰死不可! ?
ESnet (Berkeley, CA) HTTP FTP RSYNC Direct DVD // 这个一定快 =.= 美国能源局网络! 吓吓叫的呢~ ?
Easynews (Phoenix, AZ) HTTP FTP // 老牌的线上新闻群组…很老很老.. ?
FDCservers.net LLC (Chicago, IL) HTTP FTP // 主机商
Liquid Web, Inc. (Lansing, MI) HTTP RSYNC // 主机商
InterServer, Inc (Secaucus, NJ) HTTP RSYNC Direct DVD // 主机商
Ray Stedman Library (Houston, TX) HTTP RSYNC Direct DVD
欧洲 荷兰网络很发达,又是欧洲的资讯业枢纽,选荷兰其实就OK了~
Association NLUUG (Amsterdam, Netherlands) HTTP FTP RSYNC Direct DVD
LeaseWeb (Amsterdam, Netherlands) HTTP FTP RSYNC Direct DVD
Liteserver.nl (Wageningen, Netherlands) HTTP FTP Direct DVD
Combi Networks (Manchester, United Kingdom) HTTP FTP
UK Mirror Service – Univ. Kent (Manchester, United Kingdom) HTTP FTP RSYNC Direct DVD
官方的Mirrors List还有很多国家的镜像站~ CentOS full-mirrorlist.csv
RPMforge
先查询自己的作业系统版本 uname -icat /etc/*-release 再下载对应的套件
i386 版本
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ihv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm

x86_64 版本
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ihv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

—–
Jason’s Utter Ramblings Repo
新增文件
vi /etc/yum.repos.d/utterramblings.repo
文件内容
[utterramblings] name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

存盘后执行
rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
Dag Wieers
新增文件
vi /etc/yum.repos.d/dag.repo
文件内容
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

存盘后执行
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
CentOS.Karan.Org
wget -P /etc/yum.repos.d/ http://centos.karan.org/kbsingh-CentOS-Extras.repo
wget -P /etc/yum.repos.d/ http://centos.karan.org/kbsingh-CentOS-Misc.repo

rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
Webtatic Repository
wget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webtatic.repo
rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
SIPfoundry sipXecs pbx
wget -P /etc/yum.repos.d/ http://sipxecs.sipfoundry.org/pub/sipXecs/sipxecs-stable-centos.repo
RubyWorks
wget -P /etc/yum.repos.d/ http://rubyworks.rubyforge.org/RubyWorks.repo
Pidgin, the universal chat client
wget -P /etc/yum.repos.d/ http://rpm.pidgin.im/centos/pidgin.repo
kde-redhat.sf.net
wget -P /etc/yum.repos.d/ http://apt.kde-redhat.org/apt/kde-redhat/redhat/kde.repo
rpm --import http://kde-redhat.sourceforge.net/gpg-pubkey-ff6382fa-3e1ab2ca
OK了~ 以后执行yum -y update刷刷刷~ YUM的一大堆套件版本变得更丰富也更新了! ?
YUM指令介绍
yum update // 更新,加上 -y 就可以不用确认,直接安装,范例 yum -y update
yum install xxx // 安装,加上 -y 就可以不用确认,直接安装,范例 yum install -y unzip
yum remove xxx // 移除,加上 -y 就可以不用确认,直接安装,范例 yum remove -y unzip
yum clean all // 清除暂存盘案
yum search xxx // 搜寻
yum list // 列出所有档案
yum info xxx // 查询档案讯息
群组安装功能:
yum grouplist
yum groupinfo // 范例 yum groupinfo “KDE Software Development”
yum groupinstall // 范例 yum groupinstall -y “KDE Software Development”
RPM基本指令介绍
rpm -ivh xxx // 安装
rpm -e xxx // 移除
rpm -Uvh xxx // 升级
rpm -qa squid // 查看是否有安装squid
rpm -q[licdR] // 已安装的套件名称
rpm -qf // 存在于系统上面的某个档案
rpm -qc xxx | grep conf // 可以查看设定档
rpm -qp[licdR] // 未安装的某个档案名称
资料来源:
鸟哥的 Linux 私房菜 >> 第二十三章、软件安装: RPM, SRPM 与 YUM 功能
官方维基 >> 安装 RPMforge

打印本文 打印本文

关于 穷苦人家的小孩

In every democracy, the people get the government they deserve. ~Alexis de Tocqueville
上一篇:
下一篇:

您可能会喜欢

桃乃木かな 桃乃木香奈 Kana Momonogi

CloudCone全自动DD安装Windows

前阵子VPS优惠 – Clou …