GNU/Linux >> Linux の 問題 >  >> Ubuntu

AptitudeとApt-getを使用してUbuntu16.04LtsにPython-devをインストールできませんか?

Windowsホストで実行されているUbuntu16.04LTS(64ビット)ゲストにpython-devをインストールしようとしています。 apt-getを使用してからaptitudeを使用してインストールしようとしましたが、エラーが発生しているようです。

~$sudo aptitude install python-dev

与える、

The following NEW packages will be installed:
  libexpat1-dev{ab} libpython-dev{a} libpython2.7-dev{ab} python-dev python2.7-dev{ab} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.2 MB of archives. After unpacking 42.1 MB will be used.
The following packages have unmet dependencies:
 python2.7-dev : Depends: python2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
                 Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
 libexpat1-dev : Depends: libexpat1 (= 2.1.0-7) but 2.1.0-7ubuntu0.16.04.2 is installed.
 libpython2.7-dev : Depends: libpython2.7-stdlib (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
                    Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
open: 20; closed: 1293; defer: 6; conflict: 6                                                                  o
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libexpat1-dev [Not Installed]                      
2)     libpython-dev [Not Installed]                      
3)     libpython2.7-dev [Not Installed]                   
4)     python-dev [Not Installed]                         
5)     python2.7-dev [Not Installed]                      



Accept this solution? [Y/n/q/?] 

出力として。一方、

~$sudo apt-get install python-dev

与える、

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed
              Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo aptitude updateを実行しました およびsudo aptitude upgrade 、しかしそれでは問題は解決しません。

さらに、次のリンクに示されている手順を実行しました:

  • python-devをインストールできません
  • PPAを追加した後、満たされていない依存関係を解決するにはどうすればよいですか?

しかし、何も機能していないようです。

aptitudeのメッセージから、私のシステムにインストールされている依存関係は、パッケージに必要なものよりも高いバージョンであると思います(たとえば、1つのメッセージはDepends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.

私の選択肢はどちらかだと思います

  • 既存のパッケージをアンインストールする(私はむしろしたくない)、または
  • Python関連の更新されたPPAを追加します。
関連:Ubuntu12.04にJavaJDKをインストールできません:壊れたパッケージ?

私の現在のリポジトリは次のとおりです:

~$egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse

python-devをインストールする方法はありますか?

よろしくお願いします!

承認された回答:

私の新規インストールの1つには、これらのリポジトリがあります。 updateが欠落しているようです リポジトリ。

*を配置しました あなたのリストからは見えない星に星を付けましょう。

[email protected]:~$ egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security main restricted
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security universe
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security multiverse
grep: /etc/apt/sources.list.d/*: No such file or directory
[email protected]:~$ 

少なくともupdateを追加してみてください リポジトリ…次に実行します:

$ sudo apt update
$ sudo apt upgrade

Ubuntu
  1. Ubuntu16.04LTSにiostatをインストールして使用する方法

  2. Ubuntu12.04および14.04LTSにLibreoffice4.3をインストールする方法

  3. Ubuntu15.04および14.04LTSにLibreoffice4.4をインストールする方法

  1. Apt-getを使用したUbuntuへのJavaのインストール

  2. Ubuntu18.04LTSにAnsibleをインストールして構成する方法

  3. Ansibleを使用してUbuntu20.04にElasticsearchをインストールおよび構成する

  1. Ubuntu16.04LTS以降にLibreOffice6.0をインストールする方法

  2. Ubuntu18.04LTSにGitLabをインストールして構成する方法

  3. Ubuntu16.04LTSにMongoDBをインストールして構成する方法