RedHat Linux Enterprise 5.4 yum 配置
首先,rhel5系統安裝的時候其實已經有yum了,只是因為如果用官方的網站更新的話除非你是用錢買的rhel5.否則它會提示註冊之類的。所以只要把 yum的更新地址改成開源的就行了。而限定yum更新地址的檔案在/etc/yum.repos.d/裡。先把它們改成備份檔案,即在後面加.bak。
[root@killgoogle ~]# mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak
[root@killgoogle ~]# mv /etc/yum.repos.d/rpmforge.repo.rpmnew /etc/yum.repos.d/rpmforge.repo.rpmnew.bak
建立新的配置檔案:
[root@killgoogle ~]# cd /etc/yum.repos.d
[root@killgoogle ~]# touch rhel-debuginfo.repo
[root@killgoogle ~]# touch mirrors-rpmforge
[root@killgoogle ~]# touch rpmforge.repo
往新的配置檔案寫東西:
[root@killgoogle ~]#vi rhel-debuginfo.repo
[base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# vi dag.repo
[dag]
name=Dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
enabled=1
gpgcheck=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
修改第二個配置檔案:
[root@killgoogle ~]vi mirrors-rpmforge
http://apt.sw.be/redhat/el5/en/$ARCH/dag
http://archive.cs.uu.nl/mirror/dag.wieers/redhat/el5/en/$ARCH/dag
http://ftp2.lcpe.uni-sofia.bg/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
#http://ftp.heanet.ie/pub/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
http://ftp-stud.fht-esslingen.de/dag/redhat/el5/en/$ARCH/dag
http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el5/en/$ARCH/dag
http://mirrors.ircam.fr/pub/dag/redhat/el5/en/$ARCH/dag
http://rh-mirror.linux.iastate.edu/pub/dag/redhat/el5/en/$ARCH/dag
http://rpmfind.net/linux/dag/redhat/el5/en/$ARCH/dag
http://wftp.tu-chemnitz.de/pub/linux/dag/redhat/el5/en/$ARCH/dag
http://www.mirrorservice.org/sites/apt.sw.be/redhat/el5/en/$ARCH/dag
修改第三個配置檔案:
[root@killgoogle ~]# vi rpmforge.repo
# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el5/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
下面有2種方法:
這種我嘗試過,在伺服器上已搭建好 yum
這裡注意
vi /etc/yum.conf
加上這麼一句:timeout=120
和 CentOS-Base.repo 檔案中的 5.0 都修改為 5.2 就可以了
方法二:
1,修改 /etc/yum.repos.d/rhel-debuginfo.repo 為如下內容
rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://ftp.twaren.net/Linux/CentOS/5/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://ftp.twaren.net/Linux/CentOS/5/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://ftp.twaren.net/Linux/CentOS/5/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux $releasever -Addons
baseurl=http://ftp.twaren.net/Linux/CentOS/5/addons/$basearch/
gpgcheck=1
2.下載並匯入yum key
cd /etc/pki/rpm-gpg
wget http://mirror.be10.com/centos/RPM-GPG-KEY-CentOS-5
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
YUM引數介紹:
* 檢查可更新的rpm包
yum check-update
* 更新所有的rpm包
yum update
* 更新指定的rpm包,如更新kernel和kernel source
yum update kernel kernel-source
* 大規模的版本升級,與yum update不同的是,連舊的淘汰的包也升級
yum upgrade
rpm包的安裝和刪除
* 安裝rpm包,如xmms-mp3
yum install xmms-mp3
* 刪除rpm包,包括與該包有倚賴性的包
yum remove licq
* 注:同時會提示刪除licq-gnome,licq-qt,licq-text
yum暫存(/var/cache/yum/)的相關引數
* 清除暫存中rpm包檔案
yum clean packages
* 清除暫存中rpm標頭檔案
yum clearn headers
* 清除暫存中舊的rpm標頭檔案
yum clean oldheaders
* 清除暫存中舊的rpm標頭檔案和包檔案
yum clearn 或#yum clearn all
* 注:相當於yum clean packages + yum clean oldheaders
包列表
* 列出資源庫中所有可以安裝或更新的rpm包
yum list
* 列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包
yum list mozilla
yum list mozilla*
* 注:可以在rpm包名中使用匹配符,如列出所有以mozilla開頭的rpm包
* 列出資源庫中所有可以更新的rpm包
yum list updates
* 列出已經安裝的所有的rpm包
yum list installed
* 列出已經安裝的但是不包含在資源庫中的rpm包
yum list extras
* 注:通過其它網站下載安裝的rpm包
rpm包資訊顯示(info引數同list)
* 列出資源庫中所有可以安裝或更新的rpm包的資訊
yum info
* 列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包的資訊
yum info mozilla
yum info mozilla*
* 注:可以在rpm包名中使用匹配符,如列出所有以mozilla開頭的rpm包的資訊
* 列出資源庫中所有可以更新的rpm包的資訊
yum info updates
* 列出已經安裝的所有的rpm包的資訊
yum info installed
* 列出已經安裝的但是不包含在資源庫中的rpm包的資訊
yum info extras
* 注:通過其它網站下載安裝的rpm包的資訊
搜尋rpm包
* 搜尋匹配特定字元的rpm包
yum search mozilla
* 注:在rpm包名,包描述等中搜尋
* 搜尋有包含特定檔名的rpm包
yum provides realplay
五. 增加資源庫
* 例如:增加rpm.livna.org作為資源庫
* 安裝Livna.org rpms GPG key
rpm –import http://rpm.livna.org/RPM-LIVNA-GPG-KEY
* 檢查GPG Key
rpm -qa gpg-pubkey*
* 顯示Key資訊
rpm -qi gpg-pubkey-a109b1ec-3f6e28d5
* (注:如果要刪除Key,使用#rpm -e gpg-pubkey-a109b1ec-3f6e28d5)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-668786/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 啟用yum升級RedHat Linux Enterprise薦RedhatLinux
- RedHat Enterprise Linux 6.4使用Centos 6 的yum源RedhatLinuxCentOS
- Redhat(02):yum 配置Redhat
- redhat 6.0配置yumRedhat
- Oracle Enterprise Linux 6.0配置本地yumOracleLinux
- Redhat 簡單本地yum 配置Redhat
- redhat6.2配置本地yumRedhat
- redhat linux 5 之配置YUM源並安裝包RedhatLinux
- redhat 5.5 配置網路yum源Redhat
- RedHat8 配置本地yum源Redhat
- Red Hat Enterprise Linux Server release 6.2配置被動yumLinuxServer
- RedHat Linux安裝CentOS YUMRedhatLinuxCentOS
- Redhat linux 6.5 yum安裝RedhatLinux
- redhat6.6配置光碟為yum源Redhat
- linux基礎——在redhat6下配置yum源的使用LinuxRedhat
- RedHat Linux 本地Yum源安裝RedhatLinux
- 【YUM】Redhat5和6YUM源配置的區別Redhat
- redhat6.5 配置使用centos的yum源RedhatCentOS
- redhat 6 配置 yum 源的兩種方法Redhat
- linux配置yumLinux
- Linux 配置YUMLinux
- RedHat5.4搭建LAMPRedhatLAMP
- redhat配置yum環境安裝rpm包Redhat
- Redhat 6.2系統下yum的配置說明Redhat
- linux 配置yum 源Linux
- Linux本地yum配置Linux
- Redhat enterprise linux下安裝rlwrap工具RedhatLinux
- linux配置本地yum安裝--FTP yumLinuxFTP
- RedHat 6下配置本地及網路yum倉庫Redhat
- Linux RedHat ftp配置LinuxRedhatFTP
- Linux yum源配置以及yum命令講解Linux
- linux yum源配置方法Linux
- 在Linux下配置yumLinux
- Linux 本地yum源配置Linux
- Linux之RedHat7如何更換yum源LinuxRedhat
- redhat修改yum源(CENTOS)RedhatCentOS
- Redhat AS 5.4 雙網路卡繫結Redhat
- Redhat linux DNS配置指南RedhatLinuxDNS