Не удалось установить python-dev на Ubuntu 16.04 LTS использование способности и склонный - добираются

Я пытаюсь установить python-dev на LTS Ubuntu 16.04 (64 бита) гость, работающий на хосте Windows. Я пытался установить склонное использование - добираются и затем через способность, но я, кажется, сталкиваюсь с ошибками.

~$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, но это не решает проблему.

Кроме того, я выполнил шаги, данные в следующих ссылках:

но ничто, кажется, не работает.

Из сообщения способности я думаю, что зависимости, установленные в моей системе, имеют старшую версию, чем, что требуется пакетом (например, говорится в одном сообщенииDepends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.).

Я предполагаю, что мои опции любой к,

  • удалите существующие пакеты (который я быть бы), или
  • добавьте более обновленный PPA для материала Python.

Мои текущие репозитории:

~$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?

Заранее спасибо!

5
задан 13 April 2017 в 05:24

2 ответа

Одна из моих новых установок имеет эти репозитории. Вы, кажется, пропускаете приблизительно update репозитории.

я поместил * звезды в тех, я не вижу из Вашего списка.

apollo@apollo:~$ egrep -v '^#|^ * 

Попытка, по крайней мере, добавляющая эти update репозитории... затем выполненные:

$ sudo apt update
$ sudo apt upgrade
/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 apollo@apollo:~$

Попытка, по крайней мере, добавляющая эти update репозитории... затем выполненные:

$ sudo apt update
$ sudo apt upgrade
7
ответ дан 23 November 2019 в 08:46

Ввод "n" к вопросу о способности заставит его предложить другое решение - понижающий некоторые пакеты. Это работало на меня!

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

Downgrade the following packages:                                  
1)     libexpat1 [2.1.0-4ubuntu1.3 (now) -> 2.1.0-4ubuntu1 (trusty)]    
2)     libpython2.7 [2.7.6-8ubuntu0.3 (now) -> 2.7.6-8 (trusty)]        
3)     libpython2.7-minimal [2.7.6-8ubuntu0.3 (now) -> 2.7.6-8 (trusty)]
4)     libpython2.7-stdlib [2.7.6-8ubuntu0.3 (now) -> 2.7.6-8 (trusty)] 
5)     python2.7 [2.7.6-8ubuntu0.3 (now) -> 2.7.6-8 (trusty)]           
6)     python2.7-minimal [2.7.6-8ubuntu0.3 (now) -> 2.7.6-8 (trusty)]   

Accept this solution? [Y/n/q/?] y
5
ответ дан 23 November 2019 в 08:46

Другие вопросы по тегам:

Похожие вопросы: