Installing Yum On RHEL 3

預設REHL3似乎不會安裝yum 所以要自己手動安裝

1.先確認有無以下套件

python-elementtree

python-sqlite

python-urlgrabber

sqlite

rpm  –qa  |grep  python-xxxxxx

 

沒有的話請先安裝

wget http://updater.ismile.net/centos/4.4/os/i386/CentOS/RPMS/yum-2.4.3-1.c4.noarch.rpm
wget http://updater.ismile.net/centos/4.4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-4.2.1.i386.rpm
wget http://updater.ismile.net/centos/4.4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.i386.rpm
wget http://updater.ismile.net/centos/4.4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm

wget http://updater.ismile.net/centos/4.4/os/i386/CentOS/RPMS/sqlite-3.3.3-1.2.i386.rpm

 

2.Download yum套件(yum-2.0.8-1.rpm)

http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.8-1.noarch.rpm
注意,不同版本的OS安裝的yum版本也不同

 

 

3.安裝yum
rpm  –ivh  yum-2.0.8-1.noarch.rpm

4.
設定yum.conf

vi /etc/yum.conf  設定如下:

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

#base]
#ame=Red Hat Linux $releasever - $basearch - Base
#aseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/
[base]

name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/3/os/i386/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever - Updates
baseurl=http://mirror.centos.org/centos/3/updates/i386/
gpgcheck=1


5.Downloaded  gpg key
金鑰

 http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3

6.
輸入金鑰

rpm --import RPM-GPG-KEY-CentOS-3


7. 開始update

yum –y update.


[yum 指令列表]

 * 更新套件
  yum update

 * 安裝套件
  yum install

 * 升級套件
  yum upgrade

 * 移除套件
  yum remove

 * 清除暫存套件 /var/cache/yum
  yum clean

 * 列出所有套件
  yum list

 * 列出可更新套件
  yum list updates

 * 列出已安裝套件
  yum list installed

 * 檢查可更新套件名稱
  yum check-update

 * 列出所有套件資訊
  yum info

 * 列出可更新套件資訊
  yum info updates

 * 列出已安裝套件
  yum info installed

 * 列出已安裝但不在 Yum Repository 套件資訊
  yum info extras

 * 列出套件提供檔案清單
  yum provides

 * 某些套件不想透過 yum 更新

  # vi /etc/yum.conf

   於 [main] 加入不想更新的套件名稱

   exclude=kernel kernel-source

 

 

創作者介紹
創作者 aircsh 的頭像
aircsh

Aries男的學習筆記

aircsh 發表在 痞客邦 留言(0) 人氣()