Redhat企業內套件更新伺服器 -- Yum Server


Redhat Enterprise Linux
套件更新程式到了 RHEL5 使用了 RHN YUM 套件 ,

RHEL 4 以前的版本還可以用 rpm --aid 來做套件相依性的安裝 , 現在則把他取消了

改用 YUM 來管理.

企業內的yum更新伺服器 (使用 ftp)

1.
安裝  vsftpd
  
    rpm -ivh vsftpd,xxx,xxx,rpm
    chkconfig vsftpd on

2.
複製 RHEL 5 光碟到ftp目錄
   
    cp -a /media/RHEL5.2/ /var/ftp/pub

3. 
安裝 createrepo 程式 , 建立 repo index file

      rpm -ivh createrepo.xxx.xxx.rpm

      createrepo /var/ftp/pub

4.
編輯 repo file

     cp /etc/yum.repo.d/rhel-debuginfo.repo /etc/yum.repo.d/rhs.repo
                                                                                            (
名稱自訂)

     vi rhs.repo

     [rhs]
          name=RedHat Enterprise Linux Update Server
          baseurl=ftp://rhs.pvi.com.tw/pub
          enabled=1
          gpgcheck=1
          gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
  
     gpgcheck =1
表示檢查是否為原廠套件 , 若為 0 則可用其他廠套件 , 例如:fedora , CentOS ....
 

5.
rhs.repo 檔案複製到其他欲更新的Server上即可

6.
套件指令
 
     yum install xen  
安裝套件
     yum -y install xen 
自動回答 yes
     yum list   
列出套件
     yum search
關鍵字  搜尋套件
     yum info
套件名   套件資訊
     yum whatprovides
檔案名  可顯示該檔案由哪個套件提供
     yum clean all 
清除yum client 端快取


7. 
更新套件

    
當更新伺服器有了新的版本套件更新 , 必須重新執行一次 createrepo , 以更新 index files

   
yum client 端下 , yum update 套件名

 

arrow
arrow
    全站熱搜

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