08
21

關於CentOS5 YUM套件管理系統

網路上有一堆介紹如何使用它的文章,所以我這邊就不重覆了,而我這篇主要的目的是為了記錄在設定CentOS-Base.repo時碰到的問題,第一個碰到的問題是如何找到國內有提供yum update的站台,第二個問題是如果公司有設防火牆擋部份http通訊,該如何處理

在眾多介紹yum的文章中,我挑選了ftp2.tnc.edu.tw,這是國內少數有提供yum update service並且也還存活的站臺,當然,除了http之外,它也提供ftp傳輸的功能,所以我的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=ftp://ftp2.tnc.edu.tw/pub1/centos/5/os/$basearch/
gpgcheck=1
gpgkey=ftp://ftp2.tnc.edu.tw/pub1/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=ftp://ftp2.tnc.edu.tw/pub1/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=ftp://ftp2.tnc.edu.tw/pub1/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=ftp://ftp2.tnc.edu.tw/pub1/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=ftp://ftp2.tnc.edu.tw/pub1/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=ftp://ftp2.tnc.edu.tw/pub1/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=ftp://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-5

這個檔案設定好後,CentOS5的新增/移除軟體的功能就可以正常的運作,包含所有跟yum指令牽連到的更新,都可以用了

標籤: linux
評論: 0 | 引用: 0 | 閱讀: 5748
發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容: