使用yum安装python-devel

3

我正在尝试使用 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> 可能有所帮助。更多信息请参见:https://www.shellhacks.com/yum-install-specific-version-of-package/ - LazyCoder
@jordanm 那个命令是什么? - Eric He
@SANTOSHKUMARDESAI 我按照你说的尝试了一下,但是出现了类似的错误,提示需要 python-libs(x86-64) = 2.7.5-76.el7 - Eric He
@user3788685 我已经更新了我的问题 - Eric He
@EricHe 你可以尝试禁用 base 仓库并重新测试。我刚在一台测试机上安装了,没有遇到任何问题,所以我认为可能是你这边出现了一些混淆。 - user3788685
显示剩余2条评论
3个回答

5

您可以在后缀中指定架构,这对我起作用:

sudo yum install python3-devel.x86_64

0
你可以在命令中添加resolvedep子命令,这样yum会解决依赖关系(如果存在),然后你就可以使用yum安装。
yum resolvedep python-devel
yum install python-devel

你是指先运行 sudo yum resolvedep python-devel,然后再运行 sudo yum install python-devel 吗? - Eric He
运行第一个命令后,输出为:python-devel: 0:python-devel-2.7.5-76.el7.x86_64 base,但是当我运行第二个命令时,仍然出现相同的错误。 - Eric He

0

rhel 7

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接