歡迎您光臨本站 註冊首頁

關於RedHat 5U3的yum源配置

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

  今天我為了在redhat下安裝一個firefox的flash插件,引出了我對yum源的配置.用過ubuntu的spt-get,那個還是相當好用的,不過是你在選對源的基礎之上的,什麼是源呢,一開始我剛接觸源這個名詞的時候,很是不理解.不管他是什麼東西,能給你解決問題是最重要的不是?!你實際操作之後,源不過如此,就是像水源的東西,不過你在源里取到的是你系統里需要的軟體,我的理解可能有一些膚淺,希望朋友們指點.

  yum的配置,比起ubuntu里的apt-get配置起來可能要麻煩點,不過也只是格式上的不同而已.先就我自身的經歷來說一下吧.以前我都是用的光碟安裝的,就是yum中所用到的本地源的配置.

  1,yum本地源的配置與使用

  a:掛載你的光碟到一個目錄下:mount -t iso9660 /dev/cdrom /mnt/cdrom

  b:修改你的yum配置文件:編輯 /etc/yum.repos.d/rhel-debuginfo.repo 文件,裡面有給

  [rhel-debuginfo]

  name=Red Hat Enterprise Linux $releasever - $basearch - Debug

  baseurl=file:///mnt/cdrom/Server

  enabled=1

  gpgcheck=0

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  主要是baseurl,enabled,gpgcheck欄位的配置,本地就是要使用file://absolute path.

  保存並退出.

  c:yum update

  這裡有想必大家有個疑問,光碟放進光碟機后,如果能識別的話就已經自動掛載到了/media 下為什麼我們還要費事手動掛載呢?這個倒是必須的,你不掛載的話你yum需要的repodata文件是沒有任何東西的,yum要去讀這個文件才會自動給你解決依賴關係的.

  還有一個想要與大家一起學習的就是,在你沒有盤,只有iso文件時怎麼辦?很簡單,一條命令解決 mount -o loop /xx/xx/xxx.iso /mnt/cdrom你可以繼續了.呵呵~

  2、網路源的配置

  這些是我吸取前輩的精華,同樣是修改上面所提到的配置文件里的內容:

  [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

  再者導入key rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5


[火星人 ] 關於RedHat 5U3的yum源配置已經有377次圍觀

http://coctec.com/docs/linux/show-post-50671.html