【问题标题】:Install python-devel with yum用 yum 安装 python-devel
【发布时间】:2019-07-26 21:39:59
【问题描述】:

我正在尝试使用yum 安装python-devel

sudo yum install python-devel

并获得以下信息:

Resolving Dependencies
--> Running transaction check
---> Package python-devel.x86_64 0:2.7.5-76.el7 will be installed
--> Processing Dependency: python(x86-64) = 2.7.5-76.el7 for package: python-devel-2.7.5-76.el7.x86_64
--> Finished Dependency Resolution
Error: Package: python-devel-2.7.5-76.el7.x86_64 (base)
           Requires: python(x86-64) = 2.7.5-76.el7
           Installed: python-2.7.5-80.el7_6.x86_64 (@updates)
               python(x86-64) = 2.7.5-80.el7_6
           Available: python-2.7.5-68.el7.x86_64 (base)
               python(x86-64) = 2.7.5-68.el7
           Available: python-2.7.5-69.el7_5.x86_64 (updates)
               python(x86-64) = 2.7.5-69.el7_5
           Available: python-2.7.5-76.el7.x86_64 (base)
               python(x86-64) = 2.7.5-76.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我的理解是它需要这个特定版本的python:python-2.7.5-76.el7.x86_64,因此我尝试了:

sudo yum install python-2.7.5-76.el7.x86_64

但是输出:

Package matching python-2.7.5-76.el7.x86_64 already installed. Checking for update.
Nothing to do

我该怎么办?

如果我跑了:sudo yum info python,它给了我:

Installed Packages
Name        : python
Arch        : x86_64
Version     : 2.7.5
Release     : 80.el7_6
Size        : 79 k
Repo        : installed
From repo   : updates
Summary     : An interpreted, interactive, object-oriented programming language
URL         : http://www.python.org/
License     : Python
Description : Python is an interpreted, interactive, object-oriented programming
            : language often compared to Tcl, Perl, Scheme or Java. Python includes
            : modules, classes, exceptions, very high level dynamic data types and
            : dynamic typing. Python supports interfaces to many system calls and
            : libraries, as well as to various windowing systems (X11, Motif, Tk,
            : Mac and MFC).
            : 
            : Programmers can write new built-in modules for Python in C or C++.
            : Python can be used as an extension language for applications that need
            : a programmable interface.
            : 
            : Note that documentation for Python is provided in the python-docs
            : package.
            : 
            : This package provides the "python" executable; most of the actual
            : implementation is within the "python-libs" package.

【问题讨论】:

  • sudo yum downgrade <package_name>-<version_info> 可能会有所帮助。更多信息在这里:shellhacks.com/yum-install-specific-version-of-package
  • 您是否禁用或删除了更新存储库?
  • @jordanm 这个命令是什么?
  • @SANTOSHKUMARDESAI 我试过你说的,得到了​​类似的错误说你需要python-libs(x86-64) = 2.7.5-76.el7
  • 关注@user138278的解决方案,看看它是否有效

标签: python yum


【解决方案1】:

您可以在后缀中指定 arch,这对我有用:

sudo yum install python3-devel.x86_64

【讨论】:

    【解决方案2】:

    您可以将 resolvedep 子命令添加到您的调用中,这将具有 yum 解析依赖项(如果存在),然后您可以进行 yum 安装

    yum resolvedep python-devel
    yum install python-devel
    

    【讨论】:

    • 您的意思是先运行sudo yum resolvedep python-devel ,然后运行sudo yum install python-devel
    • 在我运行第一个命令后它输出:python-devel:0:python-devel-2.7.5-76.el7.x86_64 base 但是当我运行第二个命令时它仍然给我同样的错误
    【解决方案3】:

    rhel 7

    yum --enablerepo=rhel-7-server-optional-rpms install python3-devel python3

    【讨论】:

      猜你喜欢
      • 2017-07-02
      • 2017-04-29
      • 2012-11-08
      • 2023-03-21
      • 1970-01-01
      • 2018-01-09
      • 2014-05-14
      • 2016-12-26
      • 1970-01-01
      相关资源
      最近更新 更多