加速 YUM 套件升級
YUM 預設是運用鏡像站來下載更新,這邊要做的是不尋找鏡像站,而直接指定到哪個鏡像站來下載套件。
編輯 CentOS-Base.repo 裡面的 baseurl 位置到 CentOS 各國的鏡像站,這邊選的是中華電信~
# 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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
所以只要先註釋掉 mirrorlist 再把 http://mirror01.idc.hinet.net/CentOS/ 換上其他各國鏡像站的網址來符合你主機的所在位置就會很快!
台灣 前三個都超快的~ 挑一個離自己近的用囉!
中華電信 IDC HTTP FTP
中華大學 FTP RSYNC
交通大學 HTTP FTP
樹德科技大學 HTTP FTP
靜宜大學 HTTP FTP
台中縣教育網路中心 HTTP FTP Direct DVD
元智大學 HTTP FTP Direct DVD
老美
ESnet (Berkeley, CA) HTTP FTP RSYNC Direct DVD // 這個一定快 =.= 美國能源局網路! 嚇嚇叫的呢~
Facebook (Palo Alto, CA) HTTP // 沒看錯~ 真的是灰死不可!
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 site 還有很多國家的鏡像站~
RPMforge
先查詢自己的作業系統版本
i386 版本
x86_64 版本
Jason’s Utter Ramblings Repo
新增文件
文件內容
執行
Dag Wieers
新增文件
文件內容
執行
CentOS.Karan.Org
執行
Webtatic Repository
執行
SIPfoundry sipXecs pbx
RubyWorks
Pidgin, the universal chat client
kde-redhat.sf.net
OK了~ 以後執行
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
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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
#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=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-5
所以只要先註釋掉 mirrorlist 再把 http://mirror01.idc.hinet.net/CentOS/ 換上其他各國鏡像站的網址來符合你主機的所在位置就會很快!
台灣 前三個都超快的~ 挑一個離自己近的用囉!
中華電信 IDC HTTP FTP
中華大學 FTP RSYNC
交通大學 HTTP FTP
樹德科技大學 HTTP FTP
靜宜大學 HTTP FTP
台中縣教育網路中心 HTTP FTP Direct DVD
元智大學 HTTP FTP Direct DVD
老美
ESnet (Berkeley, CA) HTTP FTP RSYNC Direct DVD // 這個一定快 =.= 美國能源局網路! 嚇嚇叫的呢~
Facebook (Palo Alto, CA) HTTP // 沒看錯~ 真的是灰死不可!
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 site 還有很多國家的鏡像站~
RPMforge
先查詢自己的作業系統版本
uname -i
和 cat /etc/*-release
再下載對應的套件i386 版本
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 版本
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uhv rpmforge-release-0.3.6-1.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 http://centos.karan.org/kbsingh-CentOS-Extras.repo
wget http://centos.karan.org/kbsingh-CentOS-Misc.repo
cp kbsingh-CentOS-Extras.repo /etc/yum.repos.d
cp kbsingh-CentOS-Misc.repo /etc/yum.repos.d
執行
rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
Webtatic Repository
wget http://repo.webtatic.com/yum/webtatic.repo
cp webtatic.repo /etc/yum.repos.d
執行
rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
SIPfoundry sipXecs pbx
wget http://sipxecs.sipfoundry.org/pub/sipXecs/sipxecs-stable-centos.repo
cp sipxecs-stable-centos.repo /etc/yum.repos.d/
RubyWorks
wget http://rubyworks.rubyforge.org/RubyWorks.repo
cp RubyWorks.repo /etc/yum.repos.d/
Pidgin, the universal chat client
wget http://rpm.pidgin.im/centos/pidgin.repo
cp pidgin.repo /etc/yum.repos.d
kde-redhat.sf.net
wget http://apt.kde-redhat.org/apt/kde-redhat/redhat/kde.repo
cp kde.repo /etc/yum.repos.d/
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
沒有留言:
張貼留言