最近突然難得的開始認真工作起來,倒也不是平時不認真,而是 在工作中發掘了新的樂趣。工作以來第一次研究問題到忘了吃飯 、忘了下班時間已超時,這些要感謝我的同事讓我能專心研究。        去年年底,寫了篇關於透過 Yum Update RedHat AS 4 的文章, 當時有其他網友反應,按照步驟會出現以下的錯誤訊息: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib/python2.3/site-packages/cElementTree.so : cannot open shared object file: No such file or directory Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.3.4 (#1, April 9 2007, 19:31:20) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] If you cannot solve this problem yourself, please go to the yum faq at: http://wiki.linux.duke.edu/YumFaq 原本以為是使用者相依的套件出了問題,直到前天處理伺服器異 常狀況時,打算利用 Yum解決有問題的套件,沒想到也出現了相 同的錯誤。那時交叉做了不少測試,還特地拿了另一台機器同步 做測試,前天光是排除問題點就耗費不少時間。直到前晚下班前 仍帶著疑惑回家,直到昨天終於發現會出現這個問題,主因在於 「伺服器使用的是 for 64 位元的作業系統」。一定會有人問, 咦?就這麼簡單,沒錯就是這樣,當所有問題都往難處思考時, 大多數的資訊人員都會忘記最根本的問題,所以當我拿著32位元 的套件安裝時,難怪怎麼處理都無法排除以上的錯誤訊息。有點 愚蠢的粗心大意,倒是因此學了不少排除問題的經驗。         【 Yellow Dog Updater Modified 】 The Yellow dog Updater, Modified (YUM) is a free software /open source command line package management utility for RPM-compatible Linux operating systems. Link:        http://linux.duke.edu/yum/ 【請特別注意,套件版本是以「64位元」作業系統當作範例!】 Centos-yumconf 套件位置: http://ftp2.tnc.edu.tw/pub1/centos/4/os/alpha/CentOS/RPMS/centos-yumconf-4-4.5.noarch.rpm 其餘套件至該連結即可取得: http://ftp2.tnc.edu.tw/pub1/centos/4/os/x86_64/CentOS/RPMS/ § 安裝 yum 所需的套件: rpm --import RPM-GPG-KEY-centos4 rpm -ivh python-elementtree-1.2.6-5.el4.centos.x86_64.rpm rpm -ivh sqlite-3.3.6-2.x86_64.rpm rpm -ivh python-sqlite-1.1.7-1.2.1.x86_64.rpm rpm -ivh python-urlgrabber-2.9.8-2.noarch.rpm rpm -ivh centos-yumconf-4-4.5.noarch.rpm rpm -ivh yum-metadata-parser-1.0-8.el4.centos.x86_64.rpm rpm -ivh yum-2.4.3-4.el4.centos.noarch.rpm § 先將 CentOS-Base.repo 備份 # mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak § 編輯映射站台內容 # vi /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever - Base baseurl=http://mirror.centos.org/centos/4/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 [update] name=CentOS-$releasever - Updates baseurl=http://mirror.centos.org/centos/4/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 [addons] name=CentOS-$releasever - Addons baseurl=http://mirror.centos.org/centos/4/addons/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 [extras] name=CentOS-$releasever - Extras baseurl=http://mirror.centos.org/centos/4/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirror.centos.org/centos/4/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 [contrib] name=CentOS-$releasever - Contrib baseurl=http://mirror.centos.org/centos/4/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 按照上面步驟安裝、更新,應該是可以順利更新所需的套件,至 於是不是要全部更新,就看個人需求而定,可以確定的是,假若 全部更新那連登入畫面都會被改成 CentOS 的環境喔,這點到是 要特別留意一下!這次僅是透過 yum更新部分有問題的套件。當 然,各位說不定還會跟我一樣碰到一樣的問題,假若各位做更新 實出現下面的錯誤訊息,請參照下面的解決方式吧! 問題一:執行「yum update」出現以下錯誤 Setting up Update Process Setting up repositories not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet Cannot find a valid baseurl for repo: update Error: Cannot find a valid baseurl for repo: update 問題二:執行「yum update」出現以下錯誤 Setting up Update Process Setting up repositories http://mirror.centos.org/centos/Null/updates/x86_64/repodata/ repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. Cannot open/read repomd.xml file for repository: update failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try. Error: failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try. 以上兩個問題,問題點出在「/etc/yum.repos.d/CentOS-Base.repo」 這個設定檔上,前面已有正確範例示範,在此就不多做解釋了。 排除以上問題,各位就可以進行安全性系統維護、更新囉! ^0^/ 這週幸好有同事相互支援,要不然按照平常的工作量,的確沒有 太多時間能好好坐下來專心研究問題。所幸目前已經解決了許多 麻煩的鬼問題,接下來兩天休假總算能好好休息,雖仍有零星的 工作內容得在假日處理,但仍覺得這幾天的辛苦倒是滿踏實的。 其實,在下比較擔心的是,明天 CISCO課程沒有事先溫習課程, 明天上課應該會開始一個頭兩個大,時間管理真的不太容易啊!                           Paul                        2008.04.12
文章標籤
全站熱搜
創作者介紹
創作者 paul 的頭像
paul

Paul's Blog

paul 發表在 痞客邦 留言(0) 人氣(4,317)