? ? ?最近在rhel4上面安裝oracle 9i的時候,發現gcc沒有安裝,于是手動rpm去安裝,報多個包的依賴,無賴啊。安裝rhel5的方式,配置了yum資源庫,不能使用,才發現rhel4下面沒有repodata相關的文件,在rhel5后面,光盤中自帶有這些目錄與文件,所以我們需要手動去創建相關的文件。
????? repodate目錄下面有以下文件:
[root@i?repodata]#?ls?-lrt?total?9564?-rw-r--r--??1?root?root?????951?Dec?22?04:18?repomd.xml?-rw-r--r--??1?root?root??578572?Dec?22?04:18?primary.xml.gz?-rw-r--r--??1?root?root?7023387?Dec?22?04:18?other.xml.gz?-rw-r--r--??1?root?root?2161684?Dec?22?04:18?filelists.xml.gz????? 手動創建repodate目錄,需要用到createrepo這個命令,在rhel4光盤中默認是沒有這個包,我們需要手動去下載,這個包我隨后會上傳上來。
???? 下面是創建的過程。
1,安裝createrepo包
[root@i?soft]#?ls?createrepo-0.4.6-1.el4.rf.noarch.rpm?[root@i?soft]#?rpm?-ivh?*.rpm?warning:?createrepo-0.4.6-1.el4.rf.noarch.rpm:?V3?DSA?signature:?NOKEY,?key?ID?1aa78495?Preparing...????????????????###########################################?[100%]????1:createrepo?????????????###########################################?[100%]?2,手動mount光盤到目錄
[root@i?~]#?mkdir?/media/rhel4?[root@i?~]#?mount?/dev/cdrom?/media/rhel4?mount:?block?device?/dev/cdrom?is?write-protected,?mounting?read-only?3,創建repodate
[root@i?~]#?cd?/media?[root@i?media]#?createrepo?./?1871/1871?-?rhel4/SRPMS/comps-4AS-0.20090520.src.rpm????????????????????????????.x86_64.rpm6_64.rpmm?Saving?Primary?metadata?Saving?file?lists?metadata?Saving?other?metadata?4,配置本地repo文件
[root@i?repodata]#?cd?/etc/yum.repos.d/?[root@i?yum.repos.d]#?ls?[root@i?yum.repos.d]#?vi?local.repo?[rhel4.8]?name=rhel4.9?baseurl=file:///media/?enabled=1?gpgcheck=0?[root@i?yum.repos.d]#?yum?list?Setting?up?repositories?rhel4.8???????????????????100%?|=========================|??951?B????00:00??????Reading?repository?metadata?in?from?local?files?primary.xml.gz????????????100%?|=========================|?565?kB????00:00??????rhel4.8???:?##################################################?1871/1871?Added?1871?new?packages,?deleted?0?old?in?5.44?seconds?Installed?Packages?4Suite.x86_64????????????????????????????1.0-3??????????????????installed????????Canna-libs.i386??????????????????????????3.7p3-9.el4????????????installed????????FreeWnn-libs.i386????????????????????????1:1.10pl020-6.el4??????installed????????GConf2.i386??????????????????????????????2.8.1-2.el4????????????installed????????GConf2.x86_64????????????????????????????2.8.1-2.el4????????????installed???5,yum的命令
[root@i?yum.repos.d]#?yum?-help?usage:?yum?[options]?<?update?|?install?|?info?|?remove?|?list?|?????clean?|?provides?|?search?|?check-update?|?groupinstall?|??????groupupdate?|?grouplist?|?groupinfo?|?groupremove?|?????makecache?|?localinstall?|?erase?|?upgrade?|?whatprovides?|?????localupdate?|?resolvedep?|?shell?|?deplist?>??options:???-h,?--help????????????show?this?help?message?and?exit???-t,?--tolerant????????be?tolerant?of?errors???-C????????????????????run?entirely?from?cache,?don't?update?cache???-c?[config?file]??????config?file?location???-R?[minutes]??????????maximum?command?wait?time???-d?[debug?level]??????debugging?output?level???-e?[error?level]??????error?output?level???-y????????????????????answer?yes?for?all?questions???--version?????????????show?Yum?version?and?exit???--installroot=[path]??set?install?root???--enablerepo=[repo]???enable?one?or?more?repositories?(wildcards?allowed)???--disablerepo=[repo]??disable?one?or?more?repositories?(wildcards?allowed)???--exclude=[package]???exclude?package(s)?by?name?or?glob???--obsoletes???????????enable?obsoletes?processing?during?updates???--noplugins???????????disable?Yum?plugins?yum命令的使用,見man yum
? ? ?本文轉自7343696 51CTO博客,原文鏈接:http://blog.51cto.com/luoping/1096764,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的rhel 4/oracle linux 4/centos linux 4 配置本地yum资源库的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。