3

How can I resolve this problem (without damaging my computer!)? I want to install python-dev on my Ubuntu. I already tried aptitude, it wasn't helpful.

$ sudo apt-get install libexpat1-dev libpython-dev libpython2.7-dev 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:
 libexpat1-dev : Depends: libexpat1 (= 2.1.0-7) but 2.1.0-7ubuntu0.16.04.2 is to be installed
 libpython2.7-dev : Depends: libpython2.7-stdlib (= 2.7.11-7ubuntu1) but 2.7.12-1ubuntu0~16.04.1 is to be installed
                    Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1ubuntu0~16.04.1 is to be installed
 python-dev : 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.

Extra:

$ apt policy libexpat1-dev
libexpat1-dev:
  Installed: (none)
  Candidate: 2.1.0-7
  Version table:
     2.1.0-7 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
$ grep "^deb " /etc/apt/sources.li
st
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.canonical.com/ubuntu xenial partner
$ apt policy python2.7-dev
python2.7-dev:
  Installed: (none)
  Candidate: 2.7.11-7ubuntu1
  Version table:
     2.7.11-7ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
  • Do you have any PPA enabled? are your source up to date? – Ravexina Jun 5 '17 at 11:09
  • @Ravexina Yes. PPAs are enabled and the packages are up to date. – Milad Jun 5 '17 at 11:15
  • 1
    What is the output of apt policy libexpat1-dev and grep "^deb " /etc/apt/sources.list add it to your question, also apt policy python2.7-dev. – Ravexina Jun 5 '17 at 11:17
  • @Ravexina Question edited. – Milad Jun 5 '17 at 11:29
  • 1
    Add this line: deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse to /etc/apt/sources.list then run sudo apt update after that check see if you can install it, if it worked I'll send it as an answer. – Ravexina Jun 5 '17 at 11:35
7

Seems you don't have an important repository in your sources.list enabled.

Add this line:

deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse

to /etc/apt/sources.list, then use sudo apt update.

it should do the trick.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.