1

Ubuntu 18.04. I have a pip (2.7) installation that fails for not finding "Python.h". I tried this:

$ sudo apt install python-dev --fix-missing

and got this for output:

Reading package lists... Done
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-all
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libpython-dev libpython2.7 libpython2.7-dev python2.7-dev
The following NEW packages will be installed:
  libpython-dev libpython2.7 libpython2.7-dev python-dev python2.7-dev
0 upgraded, 5 newly installed, 0 to remove and 1 not upgraded.
Need to get 29.6 MB/29.6 MB of archives.
After this operation, 45.5 MB of additional disk space will be used.
Ign:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7 amd64 2.7.15-4ubuntu4~18.04.1
Ign:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7-dev amd64 2.7.15-4ubuntu4~18.04.1
Ign:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python2.7-dev amd64 2.7.15-4ubuntu4~18.04.1
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7 amd64 2.7.15-4ubuntu4~18.04.1
  404  Not Found [IP: 91.189.91.14 80]
Err:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7-dev amd64 2.7.15-4ubuntu4~18.04.1
  404  Not Found [IP: 91.189.91.14 80]
Err:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python2.7-dev amd64 2.7.15-4ubuntu4~18.04.1
  404  Not Found [IP: 91.189.91.14 80]
Unable to correct missing packages.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpython2.7_2.7.15-4ubuntu4~18.04.1_amd64.deb  404  Not Found [IP: 91.189.91.14 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpython2.7-dev_2.7.15-4ubuntu4~18.04.1_amd64.deb  404  Not Found [IP: 91.189.91.14 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7-dev_2.7.15-4ubuntu4~18.04.1_amd64.deb  404  Not Found [IP: 91.189.91.14 80]
E: Aborting install.

What do I need to do to get python-dev installed?

1
  • 1
    Did you remember to sudo apt update first? it looks like your package catalog refers to the 18.04.1 point release Nov 1, 2019 at 17:05

1 Answer 1

1
sudo sed -i s,//us.archive,//archive,g  /etc/apt/sources.list

or use

software-properties-gtk 

enter image description here

and choose download from main server.

after that

sudo apt update && sudo apt install python-dev

Both ways change the apt sources to main server.

2
  • 1
    Their problem is they likely didn't apt update first - and thus are working out of outdated data about the repos.
    – Thomas Ward
    Nov 1, 2019 at 17:17
  • Well, that's pretty awesome, a word I'm very careful about using. Thanks! (I did run apt update first.)
    – RadlyEel
    Nov 1, 2019 at 17:46

Not the answer you're looking for? Browse other questions tagged .