yum的配置依賴問題

  • yum install python-devel
    進行到rpm_check_debug發現
    python=2.7 is needed by (installed) python-six.noarch 0:1.9.0-8.4

  • 但是我的python版本是2.6,這是什么意思?

  • is needed by 說明python2.7是被需要的,說明python-six.noarch 0:1.9.0-8.4依賴于python2.7

但是我從來都沒安裝過python2.7,那python-six.noarch 0:1.9.0-8.4是如何被安裝的呢?

  • 可能之前強行安裝過python-six.noarch 0:1.9.0-8.4,也沒有管配置依賴的問題,導致現在出錯

  • 直接yum remove python-six.noarch,然后yum install python-devel就可以了


While Christian's method is fine, if it were me, I would just run "yum reinstall" on any package which is reporting missing dependencies. What you're looking at is the output of the "yum check" command, which you can run manually. "yum check" is looking at the state of the system's RPMDB and is looking for unfulfilled dependencies on installed packages, in your case, things like R-core and R-devel seem to be missing dependent packages.
This usually happens when you download an RPM file and manually force it in (e.g. "rpm -Uvh --force --nodeps R-*.x86_64.rpm"), but it has been known to happen on packages installed via yum in some corner cases.
The full output from "yum check" is useful to help differentiate those cases, but this advise is generally still good.
yum check dependencies \
  | grep 'has missing requires' \
  | sed 's/.\+has missing requires of //' \
  | sed 's/ [=<>].\+//' \
  | while read dep; do yum -y install "$dep"; done
The first line (whose output is good to inspect before running the whole thing) lists packages with broken dependencies, the second line parses out those with the "missing requires" problem, the third isolates the requires problem itself, the fourth strips version information, and the last conducts the installation. The fourth step is suboptimal, but the format in which the version requirements get reported (e.g. "mono(Mono.Cairo) = ('0', '2.0.0.0', None)" don't seem to be understandable to yum directly.
There has got to be some way yum can traverse the existing dependency tree and just pull in what's missing. If you know it, please post.
yum check dependencies \
  | grep 'has missing requires' \
  | sed 's/.\+has missing requires of //' \
  | sed 's/ [=<>].\+//' \
  | while read dep; do yum -y install "$dep"; done

sed 's/.+has missing requires of //'中.表示任意字符,+是轉義+,.+表示至少一個字符
sed 's/ [=<>].+//'中空格然后是[=<>]表示空格后面跟著=或者跟著<或者跟著>

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容